org.bukkit.enchantments
Class EnchantmentWrapper

java.lang.Object
  extended by org.bukkit.enchantments.Enchantment
      extended by org.bukkit.enchantments.EnchantmentWrapper

public class EnchantmentWrapper
extends Enchantment

A simple wrapper for ease of selecting Enchantments


Field Summary
 
Fields inherited from class org.bukkit.enchantments.Enchantment
ARROW_DAMAGE, ARROW_FIRE, ARROW_INFINITE, ARROW_KNOCKBACK, DAMAGE_ALL, DAMAGE_ARTHROPODS, DAMAGE_UNDEAD, DIG_SPEED, DURABILITY, FIRE_ASPECT, KNOCKBACK, LOOT_BONUS_BLOCKS, LOOT_BONUS_MOBS, LUCK, LURE, OXYGEN, PROTECTION_ENVIRONMENTAL, PROTECTION_EXPLOSIONS, PROTECTION_FALL, PROTECTION_FIRE, PROTECTION_PROJECTILE, SILK_TOUCH, THORNS, WATER_WORKER
 
Constructor Summary
EnchantmentWrapper(int id)
           
 
Method Summary
 boolean canEnchantItem(ItemStack item)
          Checks if this Enchantment may be applied to the given ItemStack.
 boolean conflictsWith(Enchantment other)
          Check if this enchantment conflicts with another enchantment.
 Enchantment getEnchantment()
          Gets the enchantment bound to this wrapper
 EnchantmentTarget getItemTarget()
          Gets the type of ItemStack that may fit this Enchantment.
 int getMaxLevel()
          Gets the maximum level that this Enchantment may become.
 String getName()
          Gets the unique name of this enchantment
 int getStartLevel()
          Gets the level that this Enchantment should start at
 
Methods inherited from class org.bukkit.enchantments.Enchantment
equals, getById, getByName, getId, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnchantmentWrapper

public EnchantmentWrapper(int id)
Method Detail

getEnchantment

public Enchantment getEnchantment()
Gets the enchantment bound to this wrapper

Returns:
Enchantment

getMaxLevel

public int getMaxLevel()
Description copied from class: Enchantment
Gets the maximum level that this Enchantment may become.

Specified by:
getMaxLevel in class Enchantment
Returns:
Maximum level of the Enchantment

getStartLevel

public int getStartLevel()
Description copied from class: Enchantment
Gets the level that this Enchantment should start at

Specified by:
getStartLevel in class Enchantment
Returns:
Starting level of the Enchantment

getItemTarget

public EnchantmentTarget getItemTarget()
Description copied from class: Enchantment
Gets the type of ItemStack that may fit this Enchantment.

Specified by:
getItemTarget in class Enchantment
Returns:
Target type of the Enchantment

canEnchantItem

public boolean canEnchantItem(ItemStack item)
Description copied from class: Enchantment
Checks if this Enchantment may be applied to the given ItemStack.

This does not check if it conflicts with any enchantments already applied to the item.

Specified by:
canEnchantItem in class Enchantment
Parameters:
item - Item to test
Returns:
True if the enchantment may be applied, otherwise False

getName

public String getName()
Description copied from class: Enchantment
Gets the unique name of this enchantment

Specified by:
getName in class Enchantment
Returns:
Unique name

conflictsWith

public boolean conflictsWith(Enchantment other)
Description copied from class: Enchantment
Check if this enchantment conflicts with another enchantment.

Specified by:
conflictsWith in class Enchantment
Parameters:
other - The enchantment to check against
Returns:
True if there is a conflict.


Copyright © 2014. All rights reserved.