Fix merge

This commit is contained in:
DerFrZocker 2022-03-05 14:20:32 +01:00
parent 7d3a91d3cf
commit a1a974f0d8
No known key found for this signature in database
GPG key ID: 713F71FFFE1DDF91
3 changed files with 20 additions and 13 deletions

View file

@ -2666,6 +2666,18 @@ public interface Material extends Keyed, Comparable<Material> {
@Deprecated
Multimap<Attribute, AttributeModifier> 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<Material> {
*/
@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);
}
}

View file

@ -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<? extends MaterialData> materialData);
CreativeCategory getCreativeCategory(Material material);
}

View file

@ -1190,4 +1190,12 @@ public interface ItemType extends Material {
*/
@NotNull
Multimap<Attribute, AttributeModifier> 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();
}