BLOCK_TYPE -> BLOCK, ITEM_TYPE -> ITEM

This commit is contained in:
DerFrZocker 2023-05-19 19:45:05 +02:00
parent a0eb63ac11
commit 3a2ab39918
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
4 changed files with 7 additions and 7 deletions

View file

@ -11077,7 +11077,7 @@ public enum Material implements Keyed, Translatable {
if (isLegacy()) {
material = Bukkit.getUnsafe().fromLegacy(this);
}
ItemType itemType = Registry.ITEM_TYPE.get(material.key);
ItemType itemType = Registry.ITEM.get(material.key);
Preconditions.checkNotNull(itemType, "Material %s is not a item type", material.getKey());
return itemType;
}
@ -11095,7 +11095,7 @@ public enum Material implements Keyed, Translatable {
if (isLegacy()) {
material = Bukkit.getUnsafe().fromLegacy(this);
}
BlockType<?> blockType = Registry.BLOCK_TYPE.get(material.key);
BlockType<?> blockType = Registry.BLOCK.get(material.key);
Preconditions.checkNotNull(blockType, "Material %s is not a block type", material.getKey());
return blockType;
}

View file

@ -79,7 +79,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see BlockType
*/
Registry<BlockType> BLOCK_TYPE = Objects.requireNonNull(Bukkit.getRegistry(BlockType.class), "No registry present for BlockType. This is a bug.");
Registry<BlockType> BLOCK = Objects.requireNonNull(Bukkit.getRegistry(BlockType.class), "No registry present for BlockType. This is a bug.");
/**
* Custom boss bars.
*
@ -117,7 +117,7 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see ItemType
*/
Registry<ItemType> ITEM_TYPE = Objects.requireNonNull(Bukkit.getRegistry(ItemType.class), "No registry present for ItemType. This is a bug.");
Registry<ItemType> ITEM = Objects.requireNonNull(Bukkit.getRegistry(ItemType.class), "No registry present for ItemType. This is a bug.");
/**
* Default server loot tables.

View file

@ -3136,7 +3136,7 @@ public interface BlockType<B extends BlockData> extends Keyed, Translatable {
@NotNull
private static <B extends BlockData> BlockType<B> getBlockType(@NotNull String key) {
NamespacedKey namespacedKey = NamespacedKey.minecraft(key);
BlockType<?> blockType = Registry.BLOCK_TYPE.get(namespacedKey);
BlockType<?> blockType = Registry.BLOCK.get(namespacedKey);
Preconditions.checkNotNull(blockType, "No BlockType found for %s. This is a bug.", namespacedKey);
return (BlockType<B>) blockType;
}
@ -3147,7 +3147,7 @@ public interface BlockType<B extends BlockData> extends Keyed, Translatable {
* Where corresponding means, that they have the same {@link NamespacedKey}
* returned by {@link #getKey()}.
*
* @return true if there is a ItemType with the same key, otherwise false
* @return true if there is an ItemType with the same key, otherwise false
* @see #getItemType()
*/
boolean hasItemType();

View file

@ -1375,7 +1375,7 @@ public interface ItemType extends Keyed, Translatable {
@NotNull
private static ItemType getItemType(@NotNull String key) {
NamespacedKey namespacedKey = NamespacedKey.minecraft(key);
ItemType itemType = Registry.ITEM_TYPE.get(namespacedKey);
ItemType itemType = Registry.ITEM.get(namespacedKey);
Preconditions.checkNotNull(itemType, "No ItemType found for %s. This is a bug.", namespacedKey);
return itemType;
}