Class PotionMaterial
java.lang.Object
com.moyskleytech.obsidian.material.ObsidianMaterial
com.moyskleytech.obsidian.material.implementations.PotionMaterial
- All Implemented Interfaces:
Comparable<ObsidianMaterial>
Special implementation of material that defines potion
-
Constructor Summary
ConstructorsConstructorDescriptionPotionMaterial(org.bukkit.potion.PotionType effects, String key, boolean extended, boolean tier2, boolean splash) Build a potion material -
Method Summary
Modifier and TypeMethodDescriptionstatic ObsidianMaterialgetMaterial(org.bukkit.inventory.ItemStack itemStack) Obtain the correct Material for a Potionstatic booleanValidate that the enchant meta data exists on the version of bukkit usedvoidsetBlock(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, normalizedName, registerAdapter, registerAdapter, registerAllBukkitMaterials, registerPluginAdapters, remove, toString, valueOf, valueOf, values, wrap, wrap
-
Constructor Details
-
PotionMaterial
public PotionMaterial(org.bukkit.potion.PotionType effects, String key, boolean extended, boolean tier2, boolean splash) Build a potion material- Parameters:
effects- The potion typekey- The key that uniquely define this materialextended- If the potion has extended durationtier2- If the potion is tier 2splash- If it's a splash potion
-
-
Method Details
-
isSupported
public static boolean isSupported()Validate that the enchant meta data exists on the version of bukkit used- Returns:
- If Potion 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
Obtain the correct Material for a Potion- Parameters:
itemStack- The potion item stack- Returns:
- Associated material
-
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
-