diff --git a/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Status.java b/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Status.java index 78f03e5..71277f5 100644 --- a/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Status.java +++ b/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Status.java @@ -7,29 +7,4 @@ public enum Status { MALFUNCTION, ACTIVE, INACTIVE, GLOBAL; - public static Status getStatus(String string) { - if(string == null) - return null; - - string = string.toUpperCase(); - switch(string) { - case "CONSTRUCTION": - return Status.CONSTRUCTION; - case "OPEN": - return Status.OPEN; - case "CLOSED": - return Status.CLOSED; - case "MAINTENANCE": - return Status.MAINTENANCE; - case "MALFUNCTION": - return Status.MALFUNCTION; - case "ACTIVE": - return Status.ACTIVE; - case "INACTIVE": - return Status.INACTIVE; - default: - return null; - } - } - } diff --git a/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Type.java b/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Type.java index d220036..7bf3101 100644 --- a/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Type.java +++ b/src/main/java/me/paradoxpixel/themepark/api/attraction/component/Type.java @@ -38,22 +38,4 @@ public enum Type { return false; } - - public static Type getType(String string) { - if(string == null) - return null; - - string = string.toUpperCase(); - switch(string) { - case "RIDE": - return Type.RIDE; - case "SHOW": - return Type.SHOW; - case "GLOBAL": - return Type.GLOBAL; - default: - return null; - } - } - } diff --git a/src/main/java/me/paradoxpixel/themepark/attraction/AttractionMenu.java b/src/main/java/me/paradoxpixel/themepark/attraction/AttractionMenu.java index 78efab5..c332129 100644 --- a/src/main/java/me/paradoxpixel/themepark/attraction/AttractionMenu.java +++ b/src/main/java/me/paradoxpixel/themepark/attraction/AttractionMenu.java @@ -131,8 +131,8 @@ public class AttractionMenu { String name = config.getConfig().getString("attraction." + id + ".name"); Location location = LocationUtils.toLocation(config.getConfig().getString("attraction." + id + ".location")); - Type type = Type.getType(config.getConfig().getString("attraction." + id + ".type")); - Status status = Status.getStatus(config.getConfig().getString("attraction." + id + ".status")); + Type type = Type.valueOf(config.getConfig().getString("attraction." + id + ".type")); + Status status = Status.valueOf(config.getConfig().getString("attraction." + id + ".status")); if(!type.containsStatus(status)) { status = type.getDefault(); config.getConfig().set("attraction." + id + ".status", type.getDefault().toString()); diff --git a/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java b/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java index 3eefa22..76e2c49 100644 --- a/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java +++ b/src/main/java/me/paradoxpixel/themepark/command/ThemeParkCommand.java @@ -308,7 +308,7 @@ public class ThemeParkCommand extends BukkitCommand { return true; } - Status status = Status.getStatus(args[2]); + Status status = Status.valueOf(args[2]); if (status == null) { String message = Message.getMessage("status.not"); message = message.replace("{status}", args[2]);