mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-12 10:38:34 +00:00
Upstream
This commit is contained in:
@ -34,7 +34,6 @@ import java.util.Set;
|
||||
public class ItemCategory extends Category<ItemType> {
|
||||
|
||||
public static final NamespacedRegistry<ItemCategory> REGISTRY = new NamespacedRegistry<>("item tag");
|
||||
private int internalId;
|
||||
|
||||
public ItemCategory(final String id) {
|
||||
super(id);
|
||||
@ -57,5 +56,4 @@ public class ItemCategory extends Category<ItemType> {
|
||||
public boolean contains(BaseItem baseItem) {
|
||||
return this.getAll().contains(baseItem.getType());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -100,21 +100,17 @@ public class ItemType implements RegistryItem {
|
||||
}
|
||||
return this.blockType;
|
||||
}
|
||||
|
||||
|
||||
public void setBlockType(BlockType blockType) {
|
||||
this.blockType = blockType;
|
||||
}
|
||||
|
||||
|
||||
public BaseItem getDefaultState() {
|
||||
if (defaultState == null) {
|
||||
this.defaultState = new BaseItemStack(this);
|
||||
}
|
||||
return this.defaultState;
|
||||
}
|
||||
|
||||
public void setDefaultState(BaseItem defaultState) {
|
||||
this.defaultState = defaultState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -130,4 +126,4 @@ public class ItemType implements RegistryItem {
|
||||
public boolean equals(Object obj) {
|
||||
return obj instanceof ItemType && this.id.equals(((ItemType) obj).id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -834,24 +834,16 @@ public final class ItemTypes {
|
||||
}
|
||||
|
||||
if (!input.split("\\[", 2)[0].contains(":")) input = "minecraft:" + input;
|
||||
ItemType result = get(input);
|
||||
return result;
|
||||
return get(input);
|
||||
}
|
||||
|
||||
public static final @Nullable ItemType get(String id) {
|
||||
public static @Nullable ItemType get(final String id) {
|
||||
return ItemType.REGISTRY.get(id);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static final ItemType get(final int ordinal) {
|
||||
public static ItemType get(final int ordinal) {
|
||||
return ItemType.REGISTRY.getByInternalId(ordinal);
|
||||
}
|
||||
|
||||
public static int size() {
|
||||
return ItemType.REGISTRY.size();
|
||||
}
|
||||
|
||||
public static Collection<ItemType> values() {
|
||||
return ItemType.REGISTRY.values();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user