Class SpawnerMaterial
java.lang.Object
com.moyskleytech.obsidian.material.ObsidianMaterial
com.moyskleytech.obsidian.material.implementations.SpawnerMaterial
- All Implemented Interfaces:
Comparable<ObsidianMaterial>
Special implementation of ObsidianMaterial to allow Spawners with entity
types
-
Constructor Summary
ConstructorsConstructorDescriptionSpawnerMaterial(org.bukkit.entity.EntityType entity, String key) Build a Spawner material for a specified entity -
Method Summary
Modifier and TypeMethodDescriptionstatic ObsidianMaterialgetMaterial(org.bukkit.inventory.ItemStack itemStack) Object the right spawner material from a spawner itemstackstatic booleanValidate that the enchant meta data exists on the version of bukkit usedSince ObsidianMaterial can have multiple name for a single material, use the normalized name when requiring uniquevoidsetBlock(org.bukkit.block.Block b) Set the block to the specified material, useful for plugin that need placementorg.bukkit.inventory.ItemStacktoItem()Object a ItemStack of the desired materialorg.bukkit.MaterialObtain the bukkit material associated with this materialMethods inherited from class com.moyskleytech.obsidian.material.ObsidianMaterial
add, add, clone, compareTo, equals, hashCode, isSimilar, match, match, match, name, registerAdapter, registerAdapter, registerAllBukkitMaterials, registerPluginAdapters, remove, toString, valueOf, valueOf, values, wrap, wrap
-
Constructor Details
-
SpawnerMaterial
Build a Spawner material for a specified entity- Parameters:
entity- The entity to spawnkey- The key representing the spawner
-
-
Method Details
-
isSupported
public static boolean isSupported()Validate that the enchant meta data exists on the version of bukkit used- Returns:
- If Spawner materials can be used
-
toMaterial
public org.bukkit.Material toMaterial()Description copied from class:ObsidianMaterialObtain the bukkit material associated with this material- Specified by:
toMaterialin classObsidianMaterial- Returns:
- the enum value associated
-
toItem
public org.bukkit.inventory.ItemStack toItem()Description copied from class:ObsidianMaterialObject a ItemStack of the desired material- Specified by:
toItemin classObsidianMaterial- Returns:
- new ItemStack
-
getMaterial
Object the right spawner material from a spawner itemstack- Parameters:
itemStack- A item stack containing a spawner- Returns:
- The correct Material for it
-
setBlock
public void setBlock(org.bukkit.block.Block b) Description copied from class:ObsidianMaterialSet the block to the specified material, useful for plugin that need placement- Specified by:
setBlockin classObsidianMaterial
-
normalizedName
Description copied from class:ObsidianMaterialSince ObsidianMaterial can have multiple name for a single material, use the normalized name when requiring unique- Overrides:
normalizedNamein classObsidianMaterial- Returns:
- normalized unique key of the material, might differ from name
-