- public class Wands {
- public static Wand MAGICAL_WAND;
- public static Wand ANCIENT_WAND;
- public static Wand WAND_OF_FOCUS;
- public static Wand WAND_OF_POWER;
- public static Wand WAND_OF_TIME;
- public static void init(ShadowIsland plugin) {
- MAGICAL_WAND = new Wand(plugin, WandType.DEFAULT);
- ANCIENT_WAND = new Wand(plugin, WandType.ANCIENT);
- WAND_OF_FOCUS = new Wand(plugin, WandType.FOCUS);
- WAND_OF_POWER = new Wand(plugin, WandType.POWER);
- WAND_OF_TIME = new Wand(plugin, WandType.TIME);
- }
- }
- public class Wand extends GenericCustomItem {
- private final ShadowIsland plugin;
- private final WandType type;
- public Wand(ShadowIsland plugin, WandType type) {
- super(plugin, type.getReadableName(), getTexture(type));
- this.plugin = plugin;
- this.type = type;
- }
- public WandType getType() {
- return type;
- }
- private final static String getTexture(WandType type) {
- String base = ShadowIsland.GRAPHICS + "wands" + File.separator;
- switch (type) {
- case ANCIENT:
- return base + "Ancient_Wand.png";
- case TIME:
- return base + "Wand_of_Time.png";
- case POWER:
- return base + "Wand_of_Power.png";
- case FOCUS:
- return base + "Wand_of_Focus.png";
- }
- return base + "Magical_Wand.png";
- }
- }
- public enum WandType {
- DEFAULT("Magic Wand"), FOCUS("Wand of Focus"), POWER("Wand of Power"), TIME(
- "Wand of Time"), ANCIENT("Ancient Wand");
- private final String readableName;
- private WandType(String readableName) {
- this.readableName = readableName;
- }
- public String getReadableName() {
- return readableName;
- }
- }