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