From 791bd8bfc1722dd4ef13914972ba62698e807a68 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Tue, 14 Jul 2020 14:06:43 -0700 Subject: [PATCH] Minor fixes (redundant code, old meta, Debug format bork, push math) --- .../denizen/objects/properties/entity/EntityColor.java | 3 --- .../denizen/scripts/commands/entity/EquipCommand.java | 4 ---- .../denizen/scripts/commands/entity/PushCommand.java | 2 +- .../com/denizenscript/denizen/utilities/debugging/Debug.java | 1 + 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java index 6aaaf7c7a5..9cefce7e16 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/properties/entity/EntityColor.java @@ -230,9 +230,6 @@ else if (type == EntityType.OCELOT && mechanism.getValue().matchesEnum(Ocelot.Ty else if (type == EntityType.RABBIT && mechanism.getValue().matchesEnum(Rabbit.Type.values())) { ((Rabbit) colored.getBukkitEntity()).setRabbitType(Rabbit.Type.valueOf(mechanism.getValue().asString().toUpperCase())); } - else if (type == EntityType.RABBIT && mechanism.getValue().matchesEnum(Rabbit.Type.values())) { - ((Rabbit) colored.getBukkitEntity()).setRabbitType(Rabbit.Type.valueOf(mechanism.getValue().asString().toUpperCase())); - } else if (type == EntityType.LLAMA) { ((Llama) colored.getBukkitEntity()).setColor(Llama.Color.valueOf(mechanism.getValue().asString().toUpperCase())); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java index 1f962df71b..89f21f199e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/EquipCommand.java @@ -46,10 +46,6 @@ public EquipCommand() { // // @Tags // - // - // - // - // // // // @Usage diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java index 83c59ec580..a11a37e1fc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/PushCommand.java @@ -290,7 +290,7 @@ public void run() { Vector v1 = lastEntity.getLocation().toVector(); Vector v3 = v2.clone().subtract(v1).normalize(); if (forceAlong) { - Vector newDest = v2.clone().subtract(Origin).normalize().multiply(runs / 20).add(Origin); + Vector newDest = v2.clone().subtract(Origin).normalize().multiply(runs * speed / 20).add(Origin); lastEntity.teleport(new Location(lastEntity.getLocation().getWorld(), newDest.getX(), newDest.getY(), newDest.getZ(), lastEntity.getLocation().getYaw(), lastEntity.getLocation().getPitch())); diff --git a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java index 22c7ada5d4..676f1c4979 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java +++ b/plugin/src/main/java/com/denizenscript/denizen/utilities/debugging/Debug.java @@ -169,6 +169,7 @@ public static void echoError(ScriptQueue sourceQueue, String message) { public static boolean errorDuplicatePrevention = false; public static void echoError(ScriptQueue sourceQueue, String message, boolean reformat) { + message = cleanTextForDebugOutput(message); if (errorDuplicatePrevention) { finalOutputDebugText("Error within error (??!!!! REPORT THIS, SOMETHING WENT SUPER WRONG!): " + message, sourceQueue, reformat); return;