mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
check if null in getItemMeta
This commit is contained in:
parent
6bc28d6b69
commit
56bd432719
@ -45,8 +45,12 @@ public final class ItemStackWrapper extends ItemStack {
|
|||||||
// Since this class is immutable, we can simply let the super class create one copy
|
// Since this class is immutable, we can simply let the super class create one copy
|
||||||
// and then store that instead of creating a clone everytime.
|
// and then store that instead of creating a clone everytime.
|
||||||
// This will significantly speed up any loop comparisons if used correctly.
|
// This will significantly speed up any loop comparisons if used correctly.
|
||||||
|
if (meta == null) {
|
||||||
|
throw new UnsupportedOperationException("#hasItemMeta() must be checked prior to this call");
|
||||||
|
} else {
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAmount() {
|
public int getAmount() {
|
||||||
|
Loading…
Reference in New Issue
Block a user