001 package org.bukkit.enchantments; 002 003 import org.bukkit.inventory.ItemStack; 004 005 /** 006 * A simple wrapper for ease of selecting {@link Enchantment}s 007 */ 008 public class EnchantmentWrapper extends Enchantment { 009 public EnchantmentWrapper(int id) { 010 super(id); 011 } 012 013 /** 014 * Gets the enchantment bound to this wrapper 015 * 016 * @return Enchantment 017 */ 018 public Enchantment getEnchantment() { 019 return Enchantment.getById(getId()); 020 } 021 022 @Override 023 public int getMaxLevel() { 024 return getEnchantment().getMaxLevel(); 025 } 026 027 @Override 028 public int getStartLevel() { 029 return getEnchantment().getStartLevel(); 030 } 031 032 @Override 033 public EnchantmentTarget getItemTarget() { 034 return getEnchantment().getItemTarget(); 035 } 036 037 @Override 038 public boolean canEnchantItem(ItemStack item) { 039 return getEnchantment().canEnchantItem(item); 040 } 041 042 @Override 043 public String getName() { 044 return getEnchantment().getName(); 045 } 046 047 @Override 048 public boolean conflictsWith(Enchantment other) { 049 return getEnchantment().conflictsWith(other); 050 } 051 }