mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Don't let items types be null.
Better fail-fast if registry doesn't load? or why-ever else this happens
This commit is contained in:
parent
6b3426e1de
commit
74bff83e38
@ -25,6 +25,8 @@ import com.sk89q.worldedit.world.item.ItemType;
|
|||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an item, without an amount value. See {@link BaseItemStack}
|
* Represents an item, without an amount value. See {@link BaseItemStack}
|
||||||
* for an instance with stack amount information.
|
* for an instance with stack amount information.
|
||||||
@ -43,6 +45,7 @@ public class BaseItem implements NbtValued {
|
|||||||
* @param itemType Type of the item
|
* @param itemType Type of the item
|
||||||
*/
|
*/
|
||||||
public BaseItem(ItemType itemType) {
|
public BaseItem(ItemType itemType) {
|
||||||
|
checkNotNull(itemType);
|
||||||
this.itemType = itemType;
|
this.itemType = itemType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +55,8 @@ public class BaseItem implements NbtValued {
|
|||||||
* @param itemType Type of the item
|
* @param itemType Type of the item
|
||||||
* @param tag NBT Compound tag
|
* @param tag NBT Compound tag
|
||||||
*/
|
*/
|
||||||
public BaseItem(ItemType itemType, CompoundTag tag) {
|
public BaseItem(ItemType itemType, @Nullable CompoundTag tag) {
|
||||||
|
checkNotNull(itemType);
|
||||||
this.itemType = itemType;
|
this.itemType = itemType;
|
||||||
this.nbtData = tag;
|
this.nbtData = tag;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user