Package ch.njol.skript.aliases
Class MaterialRegistry
java.lang.Object
ch.njol.skript.aliases.MaterialRegistry
Manages Skript's own number -> Material mappings. They are used to save
items as variables.
-
Constructor Summary
ConstructorDescriptionCreates a new material registry.MaterialRegistry(org.bukkit.Material[] materials)
Creates a material registry from existing data. -
Method Summary
Modifier and TypeMethodDescriptionint
getId(org.bukkit.Material material)
org.bukkit.Material
getMaterial(int id)
org.bukkit.Material[]
static MaterialRegistry
Loads a material registry from an array of strings.
-
Constructor Details
-
MaterialRegistry
public MaterialRegistry(org.bukkit.Material[] materials)Creates a material registry from existing data.- Parameters:
materials
- Materials by their number ids.
-
MaterialRegistry
public MaterialRegistry()Creates a new material registry.
-
-
Method Details
-
load
Loads a material registry from an array of strings. New materials will be added and legacy names updated when possible.- Parameters:
names
- Material names.- Returns:
- Material registry.
-
getMaterial
public org.bukkit.Material getMaterial(int id) -
getId
public int getId(org.bukkit.Material material) -
getMaterials
public org.bukkit.Material[] getMaterials()
-