#638: Add CreativeCategory API for Materials
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -94,6 +94,7 @@ import org.bukkit.block.data.type.TripwireHook;
|
||||
import org.bukkit.block.data.type.TurtleEgg;
|
||||
import org.bukkit.block.data.type.Wall;
|
||||
import org.bukkit.block.data.type.WallSign;
|
||||
import org.bukkit.inventory.CreativeCategory;
|
||||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.material.MaterialData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -9780,4 +9781,15 @@ public enum Material implements Keyed {
|
||||
|
||||
return Bukkit.getUnsafe().getDefaultAttributeModifiers(this, slot);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user