Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EnchantmentWrapper.java
1 package org.bukkit.enchantments;
2 
4 
5 /**
6  * A simple wrapper for ease of selecting {@link Enchantment}s
7  */
8 public class EnchantmentWrapper extends Enchantment {
9  public EnchantmentWrapper(int id) {
10  super(id);
11  }
12 
13  /**
14  * Gets the enchantment bound to this wrapper
15  *
16  * @return Enchantment
17  */
19  return Enchantment.getById(getId());
20  }
21 
22  @Override
23  public int getMaxLevel() {
24  return getEnchantment().getMaxLevel();
25  }
26 
27  @Override
28  public int getStartLevel() {
29  return getEnchantment().getStartLevel();
30  }
31 
32  @Override
33  public EnchantmentTarget getItemTarget() {
34  return getEnchantment().getItemTarget();
35  }
36 
37  @Override
38  public boolean canEnchantItem(ItemStack item) {
39  return getEnchantment().canEnchantItem(item);
40  }
41 
42  @Override
43  public String getName() {
44  return getEnchantment().getName();
45  }
46 
47  @Override
48  public boolean conflictsWith(Enchantment other) {
49  return getEnchantment().conflictsWith(other);
50  }
51 }
abstract boolean canEnchantItem(ItemStack item)
abstract EnchantmentTarget getItemTarget()
static Enchantment getById(int id)
abstract boolean conflictsWith(Enchantment other)