diff --git a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java index 91587743..134fb6be 100644 --- a/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java +++ b/src/main/java/com/gamingmesh/jobs/CMILib/CMIMaterial.java @@ -1039,7 +1039,7 @@ public enum CMIMaterial { // LEGACY_PURPUR_DOUBLE_SLAB(204, null, null, "LEGACY_PURPUR_DOUBLE_SLAB", ""), // LEGACY_COMMAND_REPEATING(210, null, null, "LEGACY_COMMAND_REPEATING", ""), // LEGACY_COMMAND_CHAIN(211, null, null, "LEGACY_COMMAND_CHAIN", ""), - LEGACY_WHEAT(59, 0, null, "Wheat Block"); + LEGACY_WHEAT(59, 0, null, "Wheat"); private Integer legacyId; private Integer legacyData; diff --git a/src/main/java/com/gamingmesh/jobs/actions/PotionItemActionInfo.java b/src/main/java/com/gamingmesh/jobs/actions/PotionItemActionInfo.java index ba72a161..8f16bb8e 100644 --- a/src/main/java/com/gamingmesh/jobs/actions/PotionItemActionInfo.java +++ b/src/main/java/com/gamingmesh/jobs/actions/PotionItemActionInfo.java @@ -31,7 +31,8 @@ public class PotionItemActionInfo extends ItemActionInfo { this.potionType = potionType; } - public String getNameWithPotion() { + @Override + public String getNameWithSub() { return getName() + ":" + potionType.toString(); } } diff --git a/src/main/java/com/gamingmesh/jobs/container/Job.java b/src/main/java/com/gamingmesh/jobs/container/Job.java index c7a4d787..2032afde 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Job.java +++ b/src/main/java/com/gamingmesh/jobs/container/Job.java @@ -19,7 +19,6 @@ package com.gamingmesh.jobs.container; import com.gamingmesh.jobs.Jobs; -import com.gamingmesh.jobs.actions.PotionItemActionInfo; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; @@ -226,14 +225,9 @@ public class Job { public JobInfo getJobInfo(ActionInfo action, int level) { BiPredicate condition = (jobInfo, actionInfo) -> { - if (actionInfo instanceof PotionItemActionInfo) { - return jobInfo.getName().equalsIgnoreCase(((PotionItemActionInfo) action).getNameWithPotion()) || - (jobInfo.getName() + ":" + jobInfo.getMeta()).equalsIgnoreCase(((PotionItemActionInfo) action).getNameWithPotion()); - } - return jobInfo.getName().equalsIgnoreCase(action.getNameWithSub()) || - (jobInfo.getName() + ":" + jobInfo.getMeta()).equalsIgnoreCase(action.getNameWithSub()) || - jobInfo.getName().equalsIgnoreCase(action.getName()); + (jobInfo.getName() + ":" + jobInfo.getMeta()).equalsIgnoreCase(action.getNameWithSub()) || + jobInfo.getName().equalsIgnoreCase(action.getName()); }; for (JobInfo info : getJobInfo(action.getType())) { diff --git a/src/main/java/com/gamingmesh/jobs/container/Potion.java b/src/main/java/com/gamingmesh/jobs/container/Potion.java index d900524c..9899faf6 100644 --- a/src/main/java/com/gamingmesh/jobs/container/Potion.java +++ b/src/main/java/com/gamingmesh/jobs/container/Potion.java @@ -22,30 +22,31 @@ package com.gamingmesh.jobs.container; * API reference for names */ public enum Potion { - AWKWARD("AWKWARD"), - FIRE_RESISTANCE("FIRE_RESISTANCE"), - INSTANT_DAMAGE("INSTANT_DAMAGE"), - INSTANT_HEAL("INSTANT_HEAL"), - INVISIBILITY("INVISIBILITY"), - JUMP("JUMP"), - LUCK("LUCK"), - MUNDANE("MUNDANE"), - NIGHT_VISION("NIGHT_VISION"), - POISON("POISON"), - REGEN("REGEN"), - SLOW_FALLING("SLOW_FALLING"), - SLOWNESS("SLOWNESS"), - SPEED("SPEED"), - STRENGTH("STRENGTH"), - THICK("THICK"), - TURTLE_MASTER("TURTLE_MASTER"), - WATER_BREATHING("WATER_BREATHING"), - WEAKNESS("WEAKNESS"); + AWKWARD("awkward"), + FIRE_RESISTANCE("fire_resistance"), + INSTANT_DAMAGE("instant_damage"), + INSTANT_HEAL("instant_heal"), + INVISIBILITY("invisibility"), + JUMP("jump"), + LUCK("luck"), + MUNDANE("mundane"), + NIGHT_VISION("night_vision"), + LONG_NIGHT_VISION("long_night_vision"), + POISON("poison"), + REGEN("regen"), + SLOW_FALLING("slow_falling"), + SLOWNESS("slowness"), + SPEED("speed"), + STRENGTH("strength"), + THICK("thick"), + TURTLE_MASTER("turtle_master"), + WATER_BREATHING("water_breathing"), + WEAKNESS("weakness"); private final String name; Potion(String name) { - this.name = name; + this.name = name.toUpperCase(); } public String getName() { @@ -53,12 +54,12 @@ public enum Potion { } public static Potion getByName(String name) { - name = name.replace("_", ""); for (Potion one : Potion.values()) { if (one.name.equalsIgnoreCase(name)) { return one; } } + return null; } }