This commit is contained in:
MattBDev
2019-06-25 13:07:47 -04:00
parent a1c15e1c39
commit a69b239848
143 changed files with 1042 additions and 2405 deletions

View File

@ -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());
}
}

View File

@ -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);
}
}
}

View File

@ -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();
}
}