diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java index f264fa9a..84995303 100644 --- a/src/main/java/com/gamingmesh/jobs/Jobs.java +++ b/src/main/java/com/gamingmesh/jobs/Jobs.java @@ -94,10 +94,10 @@ import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.hooks.HookManager; import com.gamingmesh.jobs.i18n.Language; import com.gamingmesh.jobs.listeners.JobsListener; -import com.gamingmesh.jobs.listeners.JobsPayment14Listener; +import com.gamingmesh.jobs.listeners.JobsPayment1_14Listener; import com.gamingmesh.jobs.listeners.JobsPaymentListener; import com.gamingmesh.jobs.listeners.PistonProtectionListener; -import com.gamingmesh.jobs.listeners.JobsPayment16Listener; +import com.gamingmesh.jobs.listeners.JobsPayment1_16Listener; import com.gamingmesh.jobs.listeners.PlayerSignEdit1_20Listeners; import com.gamingmesh.jobs.selection.SelectionManager; import com.gamingmesh.jobs.stuff.Loging; @@ -794,10 +794,10 @@ public final class Jobs extends JavaPlugin { pm.registerEvents(new JobsListener(getInstance()), getInstance()); pm.registerEvents(new JobsPaymentListener(getInstance()), getInstance()); if (Version.isCurrentEqualOrHigher(Version.v1_14_R1)) { - pm.registerEvents(new JobsPayment14Listener(), getInstance()); + pm.registerEvents(new JobsPayment1_14Listener(), getInstance()); } if (Version.isCurrentEqualOrHigher(Version.v1_16_R3)) { - pm.registerEvents(new JobsPayment16Listener(), getInstance()); + pm.registerEvents(new JobsPayment1_16Listener(), getInstance()); } if (Version.isCurrentEqualOrHigher(Version.v1_20_R1)) { diff --git a/src/main/java/com/gamingmesh/jobs/container/ActionType.java b/src/main/java/com/gamingmesh/jobs/container/ActionType.java index 08019512..a5ccd3ef 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ActionType.java +++ b/src/main/java/com/gamingmesh/jobs/container/ActionType.java @@ -18,52 +18,58 @@ package com.gamingmesh.jobs.container; +import net.Zrips.CMILib.Container.CMIText; + public enum ActionType { - BREAK("Break"), + BREAK(), STRIPLOGS("StripLogs"), TNTBREAK("TNTBreak"), - PLACE("Place"), - KILL("Kill"), + PLACE(), + KILL(), MMKILL("MMKill"), - FISH("Fish"), - CRAFT("Craft"), + FISH(), + CRAFT(), VTRADE("VTrade"), - SMELT("Smelt"), - BREW("Brew"), - ENCHANT("Enchant"), - REPAIR("Repair"), - BREED("Breed"), - TAME("Tame"), - DYE("Dye"), - SHEAR("Shear"), - MILK("Milk"), - EXPLORE("Explore"), - EAT("Eat"), + SMELT(), + BREW(), + ENCHANT(), + REPAIR(), + BREED(), + TAME(), + DYE(), + SHEAR(), + MILK(), + EXPLORE(), + EAT(), CUSTOMKILL("custom-kill"), - COLLECT("Collect"), - BAKE("Bake"), - BUCKET("Bucket"); + COLLECT(), + BAKE(), + BUCKET(); private String name; ActionType(String name) { - this.name = name; + this.name = name; + } + + ActionType() { + this.name = CMIText.firstToUpperCase(this.toString()); } public String getName() { - return name; + return name; } public static ActionType getByName(String name) { - if (name != null) { - name = name.replace("_", ""); + if (name != null) { + name = name.replace("_", ""); - for (ActionType one : ActionType.values()) { - if (one.name.equalsIgnoreCase(name)) - return one; - } - } + for (ActionType one : ActionType.values()) { + if (one.name.equalsIgnoreCase(name)) + return one; + } + } - return null; + return null; } } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment14Listener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_14Listener.java similarity index 98% rename from src/main/java/com/gamingmesh/jobs/listeners/JobsPayment14Listener.java rename to src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_14Listener.java index 9e2729ed..7c7ea183 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment14Listener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_14Listener.java @@ -24,7 +24,7 @@ import com.gamingmesh.jobs.actions.ItemActionInfo; import com.gamingmesh.jobs.container.ActionType; import com.gamingmesh.jobs.container.PlayerCamp; -public final class JobsPayment14Listener implements Listener { +public final class JobsPayment1_14Listener implements Listener { // BlockCookEvent does not have "cooking owner" private final Map> campPlayers = new HashMap<>(); diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment16Listener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_16Listener.java similarity index 95% rename from src/main/java/com/gamingmesh/jobs/listeners/JobsPayment16Listener.java rename to src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_16Listener.java index b49e7319..a05cbf57 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment16Listener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPayment1_16Listener.java @@ -10,7 +10,7 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerBucketEntityEvent; -public class JobsPayment16Listener implements Listener { +public class JobsPayment1_16Listener implements Listener { @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onEntityBucketed(PlayerBucketEntityEvent event) { Player player = event.getPlayer();