Code cleanup

This commit is contained in:
Christian Koop 2022-03-18 20:35:58 +01:00
parent 1b132a3b0c
commit b99896d41e
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
2 changed files with 16 additions and 1 deletions

View File

@ -17,7 +17,20 @@ import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.projectiles.ProjectileSource;
import static com.songoda.epicenchants.enums.TriggerType.*;
import static com.songoda.epicenchants.enums.TriggerType.ATTACK_MOB_MELEE;
import static com.songoda.epicenchants.enums.TriggerType.ATTACK_MOB_RANGE;
import static com.songoda.epicenchants.enums.TriggerType.ATTACK_PLAYER_MELEE;
import static com.songoda.epicenchants.enums.TriggerType.ATTACK_PLAYER_RANGE;
import static com.songoda.epicenchants.enums.TriggerType.DEFENSE_MOB_MELEE;
import static com.songoda.epicenchants.enums.TriggerType.DEFENSE_MOB_RANGE;
import static com.songoda.epicenchants.enums.TriggerType.DEFENSE_PLAYER_MELEE;
import static com.songoda.epicenchants.enums.TriggerType.DEFENSE_PLAYER_RANGE;
import static com.songoda.epicenchants.enums.TriggerType.EXPLOSION_DAMAGE;
import static com.songoda.epicenchants.enums.TriggerType.FALL_DAMAGE;
import static com.songoda.epicenchants.enums.TriggerType.FIRE_DAMAGE;
import static com.songoda.epicenchants.enums.TriggerType.KILLED_MOB;
import static com.songoda.epicenchants.enums.TriggerType.LAVA_DAMAGE;
import static com.songoda.epicenchants.enums.TriggerType.POISON_DAMAGE;
public class EntityListener implements Listener {
private final EpicEnchants instance;

View File

@ -99,6 +99,8 @@ public class GeneralUtils {
}
public static Object parseJS(String toParse, String type, Object def) {
// FIXME: JavaScript != Math...
// Input "false ? (8 * 3) : (4 * 3)" fails for obvious reasons
return MathUtils.eval(toParse, "[EpicEnchants] One of your " + type + " expressions is not properly formatted.");
}
}