From a1a974f0d8419f79e435c0b734bb51eaffe61575 Mon Sep 17 00:00:00 2001 From: DerFrZocker Date: Sat, 5 Mar 2022 14:20:32 +0100 Subject: [PATCH] Fix merge --- src/main/java/org/bukkit/Material.java | 22 ++++++++++--------- src/main/java/org/bukkit/UnsafeValues.java | 3 --- .../java/org/bukkit/inventory/ItemType.java | 8 +++++++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 10236e52..3ffb9284 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -2666,6 +2666,18 @@ public interface Material extends Keyed, Comparable { @Deprecated Multimap getDefaultAttributeModifiers(@NotNull EquipmentSlot slot); + /** + * Get the {@link CreativeCategory} to which this material belongs. + * + * @return the creative category. null if does not belong to a category + * @see Material#asItemType() + * @see ItemType#getCreativeCategory() + * @deprecated Can only get creative category from ItemType + */ + @Nullable + @Deprecated + CreativeCategory getCreativeCategory(); + /** * @param other to compare to. * @return negative if this old enum is lower, zero if equal and positive if higher than the given old enum. @@ -2689,14 +2701,4 @@ public interface Material extends Keyed, Comparable { */ @Deprecated public abstract int ordinal(); - - /** - * Get the {@link CreativeCategory} to which this material belongs. - * - * @return the creative category. null if does not belong to a category - */ - @Nullable - public CreativeCategory getCreativeCategory() { - return Bukkit.getUnsafe().getCreativeCategory(this); - } } diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java index 1bbc01d9..915c16be 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -2,7 +2,6 @@ package org.bukkit; import org.bukkit.advancement.Advancement; import org.bukkit.block.data.BlockData; -import org.bukkit.inventory.CreativeCategory; import org.bukkit.inventory.ItemStack; import org.bukkit.material.MaterialData; import org.bukkit.plugin.InvalidPluginException; @@ -75,6 +74,4 @@ public interface UnsafeValues { @Deprecated Material createLegacyMaterial(String name, int id, int maxStackSize, short maxDurability, Class materialData); - - CreativeCategory getCreativeCategory(Material material); } diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java index 4c69cf0a..e0a351db 100644 --- a/src/main/java/org/bukkit/inventory/ItemType.java +++ b/src/main/java/org/bukkit/inventory/ItemType.java @@ -1190,4 +1190,12 @@ public interface ItemType extends Material { */ @NotNull Multimap getDefaultAttributeModifiers(@NotNull EquipmentSlot slot); + + /** + * Get the {@link CreativeCategory} to which this material belongs. + * + * @return the creative category. null if does not belong to a category + */ + @Nullable + CreativeCategory getCreativeCategory(); }