Fix config values not being evaluated properly [SD-8381, SD-8387]

Bug introduced in 423ae8977e
This commit is contained in:
Christian Koop 2021-07-10 21:59:58 +02:00
parent 1053438274
commit a4121cb0a3
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
3 changed files with 3 additions and 6 deletions

View File

@ -123,7 +123,6 @@ public class EpicEnchants extends SongodaPlugin {
@Override
public void onDataLoad() {
}
@Override

View File

@ -28,6 +28,6 @@ public class LeveledModifier {
String toTest = Placeholders.setPlaceholders(string, user, opponent, level);
Object value = GeneralUtils.parseJS(toTest, "LeveledModifier", def);
return value instanceof Double ? (double)value : (int)value;
return value instanceof Double ? (double) value : (int) value;
}
}

View File

@ -85,8 +85,7 @@ public class GeneralUtils {
return null;
}
public static int getHeldItemSlot(Player entity, Event event) {
Player player = (Player) entity;
public static int getHeldItemSlot(Player player, Event event) {
int slot = player.getInventory().getHeldItemSlot();
try {
@ -100,7 +99,6 @@ public class GeneralUtils {
}
public static Object parseJS(String toParse, String type, Object def) {
return MathUtils.eval("[EpicEnchants] One of your " + type + " expressions is not properly formatted.", toParse);
return MathUtils.eval(toParse, "[EpicEnchants] One of your " + type + " expressions is not properly formatted.");
}
}