diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java index eb89503cab..d3a8978181 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/AgeCommand.java @@ -95,7 +95,7 @@ public void execute(final ScriptEntry scriptEntry) { boolean lock = scriptEntry.hasObject("lock"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (lock ? db("lock", true) : ""), (ageType != null ? db("agetype", ageType) : db("age", age)), db("entities", entities.toString())); + Debug.report(scriptEntry, getName(), (lock ? db("lock", true) : ""), (ageType != null ? db("agetype", ageType) : db("age", age)), db("entities", entities)); } for (EntityTag entity : entities) { if (entity.isSpawned()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java index 400bb2bf9d..cc194ff3ee 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/BurnCommand.java @@ -74,7 +74,7 @@ public void execute(final ScriptEntry scriptEntry) { List entities = (List) scriptEntry.getObject("entities"); DurationTag duration = scriptEntry.getObjectTag("duration"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), duration, db("entities", entities.toString())); + Debug.report(scriptEntry, getName(), duration, db("entities", entities)); } for (EntityTag entity : entities) { if (entity.isSpawned()) { 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 9a13480d2d..835fc5dc48 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 @@ -126,7 +126,7 @@ public void execute(ScriptEntry scriptEntry) { Map equipment = (Map) scriptEntry.getObject("equipment"); List entities = (List) scriptEntry.getObject("entities"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("entities", entities.toString()), db("equipment", equipment.toString())); + Debug.report(scriptEntry, getName(), db("entities", entities), db("equipment", equipment)); } for (EntityTag entity : entities) { if (entity.isGeneric()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FakeEquipCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FakeEquipCommand.java index 748b203732..ce543dd0ef 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FakeEquipCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FakeEquipCommand.java @@ -170,7 +170,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag reset = scriptEntry.getElement("reset"); DurationTag duration = scriptEntry.getObjectTag("duration"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("entities", entities.toString()), db("equipment", equipment.toString()), reset, duration, db("for", playersFor)); + Debug.report(scriptEntry, getName(), db("entities", entities), db("equipment", equipment), reset, duration, db("for", playersFor)); } boolean isReset = reset != null && reset.asBoolean(); for (PlayerTag player : playersFor) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java index 047ab6979b..aae908e021 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/FlyCommand.java @@ -135,7 +135,7 @@ public void execute(final ScriptEntry scriptEntry) { if (entities.get(entities.size() - 1) != entity) { controller = entity; if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), "Flight control defaulting to " + controller); + Debug.echoDebug(scriptEntry, "Flight control defaulting to " + controller); } break; } @@ -144,7 +144,7 @@ public void execute(final ScriptEntry scriptEntry) { // If the controller is still null, we cannot continue if (controller == null) { if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), "There is no one to control the flight's path!"); + Debug.echoDebug(scriptEntry, "There is no one to control the flight's path!"); } return; } @@ -162,7 +162,7 @@ public void execute(final ScriptEntry scriptEntry) { // Add the controller to the entity list if (!found) { if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), "Adding controller " + controller + " to flying entities."); + Debug.echoDebug(scriptEntry, "Adding controller " + controller + " to flying entities."); } entities.add(0, controller); } @@ -172,13 +172,8 @@ public void execute(final ScriptEntry scriptEntry) { final float rotationThreshold = ((ElementTag) scriptEntry.getObject("rotation_threshold")).asFloat(); boolean cancel = scriptEntry.hasObject("cancel"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (cancel ? db("cancel", cancel) : "") + - db("origin", origin) + - db("entities", entities.toString()) + - db("speed", speed) + - db("rotation threshold degrees", rotationThreshold) + - (freeflight ? db("controller", controller) - : db("destinations", destinations.toString()))); + Debug.report(scriptEntry, getName(), (cancel ? db("cancel", true) : ""), origin, db("entities", entities), + db("speed", speed), db("rotation threshold degrees", rotationThreshold), (freeflight ? controller : db("destinations", destinations))); } if (!cancel) { for (EntityTag entity : entities) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java index b009a7a251..9992f8443b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HeadCommand.java @@ -67,7 +67,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag skin = scriptEntry.getElement("skin"); MaterialTag material = scriptEntry.getObjectTag("material"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("entities", entities.toString()), skin, material); + Debug.report(scriptEntry, getName(), db("entities", entities), skin, material); } ItemStack item = null; if (skin != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java index 745cdbb2ad..6ee5284e69 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/HealthCommand.java @@ -117,7 +117,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag heal = scriptEntry.getElement("heal"); List targets = (List) scriptEntry.getObject("target"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), quantity, action, heal, db("target", targets.toString())); + Debug.report(scriptEntry, getName(), quantity, action, heal, db("target", targets)); } if (quantity == null && action == null) { Debug.echoError(scriptEntry.getResidingQueue(), "Null quantity!"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java index f077ef72cd..be45131364 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java @@ -114,7 +114,7 @@ else if (holderObject instanceof LocationTag) { } boolean cancel = scriptEntry.hasObject("cancel"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (cancel ? db("cancel", "true") : ""), db("entities", entities.toString()), (holder != null ? db("holder", holder) : db("holder", holderLoc))); + Debug.report(scriptEntry, getName(), (cancel ? db("cancel", "true") : ""), db("entities", entities), db("holder", holder), db("holder", holderLoc)); } for (EntityTag entity : entities) { if (entity.isSpawned() && entity.isLivingEntity()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java index f94e0a6da2..51f43609f0 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LookCommand.java @@ -119,7 +119,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag pitch = scriptEntry.getElement("pitch"); ElementTag cancel = scriptEntry.getElement("cancel"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), cancel, loc, duration, yaw, pitch, db("entities", entities.toString())); + Debug.report(scriptEntry, getName(), cancel, loc, duration, yaw, pitch, db("entities", entities)); } for (EntityTag entity : entities) { if (entity.isSpawned()) { 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 2f4baa1052..48708bd638 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 @@ -183,9 +183,7 @@ public void execute(final ScriptEntry scriptEntry) { : null); // TODO: Should this be checked in argument parsing? if (destination == null) { - if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), "No destination specified!"); - } + Debug.echoError("No destination specified!"); scriptEntry.setFinished(true); return; } @@ -198,7 +196,7 @@ public void execute(final ScriptEntry scriptEntry) { ElementTag precision = scriptEntry.getElement("precision"); ElementTag ignore_collision = scriptEntry.getElement("ignore_collision"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("origin", originEntity != null ? originEntity : originLocation), db("entities", entities.toString()), + Debug.report(scriptEntry, getName(), db("origin", originEntity != null ? originEntity : originLocation), db("entities", entities), destination, speedElement, duration, script, force_along, precision, (no_rotate ? db("no_rotate", "true") : ""), (no_damage ? db("no_damage", "true") : ""), ignore_collision, definitions); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java index f180151274..c96ffd2bd1 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/ShootCommand.java @@ -214,9 +214,7 @@ public void execute(final ScriptEntry scriptEntry) { originLocation.getDirection().multiply(30))) : null)); // TODO: Same as PUSH -- is this the place to do this? if (destination == null) { - if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), "No destination specified!"); - } + Debug.echoError("No destination specified!"); return; } final List entities = (List) scriptEntry.getObject("entities"); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java index 30ced30ecb..39806acad3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/SpawnCommand.java @@ -117,7 +117,7 @@ public void execute(final ScriptEntry scriptEntry) { ElementTag spread = scriptEntry.getElement("spread"); boolean persistent = scriptEntry.hasObject("persistent"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("entities", entities.toString()), location, spread, target, (persistent ? db("persistent", "true") : "")); + Debug.report(scriptEntry, getName(), db("entities", entities), location, spread, target, (persistent ? db("persistent", "true") : "")); } // Keep a ListTag of entities that can be called using later in the script queue ListTag entityList = new ListTag(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java index 3ac6381e74..110997f149 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/TeleportCommand.java @@ -102,7 +102,7 @@ public void execute(final ScriptEntry scriptEntry) { LocationTag location = scriptEntry.getObjectTag("location"); List entities = (List) scriptEntry.getObject("entities"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), location, db("entities", entities.toString())); + Debug.report(scriptEntry, getName(), location, db("entities", entities)); } for (EntityTag entity : entities) { if (entity.isFake && entity.getWorld().equals(location.getWorld())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java index a8d779fcbd..7320f75638 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/GiveCommand.java @@ -166,7 +166,7 @@ public void execute(ScriptEntry scriptEntry) { items = (List) items_object; } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("Type", type.name()), inventory, quantity, unlimit_stack_size, (items != null ? db("Items", items) : ""), slot); + Debug.report(scriptEntry, getName(), db("Type", type.name()), inventory, quantity, unlimit_stack_size, db("Items", items), slot); } switch (type) { case MONEY: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java index eea4b72351..4ef8649b88 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/item/InventoryCommand.java @@ -265,7 +265,7 @@ public void execute(final ScriptEntry scriptEntry) { DataAction flagAction = (DataAction) scriptEntry.getObject("flag_action"); TimeTag expiration = scriptEntry.getObjectTag("expiration"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("actions", actions.toString()), destination, origin, mechanism, mechanismValue, flagAction, expiration, slot); + Debug.report(scriptEntry, getName(), db("actions", actions), destination, origin, mechanism, mechanismValue, flagAction, expiration, slot); } int slotId = SlotHelper.nameToIndexFor(slot.asString(), destination.getInventory().getHolder()); if (slotId < 0) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java index 95be12c5f1..5ff187b0b9 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/DespawnCommand.java @@ -74,8 +74,7 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException public void execute(final ScriptEntry scriptEntry) { List npcs = (List) scriptEntry.getObject("npcs"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("NPCs", npcs.toString())); + Debug.report(scriptEntry, getName(), db("NPCs", npcs)); } for (NPCTag npc : npcs) { if (npc.getCitizen().hasTrait(Spawned.class)) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java index 17a0605a7e..1bf2241f67 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/PoseCommand.java @@ -102,8 +102,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag idElement = scriptEntry.getElement("pose_id"); LocationTag pose_loc = scriptEntry.getObjectTag("pose_loc"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("Target", target.toString()), (target == TargetType.PLAYER ? Utilities.getEntryPlayer(scriptEntry) : ""), npc, - db("Action", action.toString()), idElement, pose_loc); + Debug.report(scriptEntry, getName(), db("Target", target), (target == TargetType.PLAYER ? Utilities.getEntryPlayer(scriptEntry) : ""), npc, db("Action", action), idElement, pose_loc); } if (!npc.getCitizen().hasTrait(Poses.class)) { npc.getCitizen().addTrait(Poses.class); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java index d22cf09037..2076f41505 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ActionBarCommand.java @@ -121,11 +121,7 @@ public void execute(ScriptEntry scriptEntry) { text = TagManager.tag(text, context); } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("Message", text) - + db("Targets", targets) - + (formatObj != null ? formatObj.debug() : "") - + (perPlayerObj != null ? perPlayerObj.debug() : "")); + Debug.report(scriptEntry, getName(), db("message", text), db("targets", targets), formatObj, perPlayerObj); } FormatScriptContainer format = formatObj == null ? null : (FormatScriptContainer) formatObj.getContainer(); for (PlayerTag player : targets) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java index 29aa6ad439..97abdff2c4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/AdvancementCommand.java @@ -205,13 +205,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag y = scriptEntry.getElement("y"); ElementTag progressLength = scriptEntry.getElement("progress_length"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, name, id.debug() + (parent != null ? parent.debug() : "") - + (delete != null ? delete.debug() : "") + (grant != null ? grant.debug() : "") - + (revoke != null ? revoke.debug() : "") - + icon.debug() + title.debug() + description.debug() - + (background != null ? background.debug() : "") - + (progressLength != null ? progressLength.debug() : "") - + frame.debug() + toast.debug() + announce.debug() + hidden.debug() + x.debug() + y.debug()); + Debug.report(scriptEntry, name, id, parent, delete, grant, revoke, icon, title, description, background, progressLength, frame, toast, announce, hidden, x, y); } final AdvancementHelper advancementHelper = NMSHandler.getAdvancementHelper(); NamespacedKey key = new NamespacedKey(Denizen.getInstance(), id.asString()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java index 6479481739..b6340e9f65 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ChatCommand.java @@ -124,7 +124,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag message = scriptEntry.getElement("message"); ElementTag chatRange = scriptEntry.getElement("range"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), talkers.debug() + targets.debug() + message.debug() + chatRange.debug()); + Debug.report(scriptEntry, getName(), talkers, targets, message, chatRange); } DenizenSpeechContext context = new DenizenSpeechContext(message.asString(), scriptEntry, chatRange.asDouble()); if (!targets.isEmpty()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java index 1b2417fee7..48d83a63ad 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/CompassCommand.java @@ -67,9 +67,7 @@ public void addCustomTabCompletions(String arg, Consumer addOne) { @Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { - for (Argument arg : scriptEntry) { - if (!scriptEntry.hasObject("location") && arg.matchesArgumentType(LocationTag.class)) { scriptEntry.addObject("location", arg.asType(LocationTag.class)); @@ -82,7 +80,6 @@ else if (!scriptEntry.hasObject("reset") arg.reportUnhandled(); } } - if (!scriptEntry.hasObject("location") && !scriptEntry.hasObject("reset")) { throw new InvalidArgumentsException("Missing location argument!"); } @@ -92,15 +89,12 @@ else if (!scriptEntry.hasObject("reset") @Override public void execute(ScriptEntry scriptEntry) { - LocationTag location = scriptEntry.getObjectTag("location"); ElementTag reset = scriptEntry.getElement("reset"); Player player = Utilities.getEntryPlayer(scriptEntry).getPlayerEntity(); - if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (location != null ? location.debug() : "") + reset.debug()); + Debug.report(scriptEntry, getName(), location, reset); } - if (reset.asBoolean()) { Location bed = player.getBedSpawnLocation(); player.setCompassTarget(bed != null ? bed : player.getWorld().getSpawnLocation()); @@ -108,7 +102,6 @@ public void execute(ScriptEntry scriptEntry) { else { player.setCompassTarget(location); } - } } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/DisguiseCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/DisguiseCommand.java index 6b369a46d6..a84aff7f19 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/DisguiseCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/DisguiseCommand.java @@ -314,10 +314,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag global = scriptEntry.getElement("global"); List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), entity.debug() - + (cancel != null ? cancel.debug() : as.debug()) - + (global != null ? global.debug() : "") - + db("players", players)); + Debug.report(scriptEntry, getName(), entity, cancel, as, global, db("players", players)); } boolean isGlobal = global != null && global.asBoolean(); HashMap playerMap = disguises.get(entity.getUUID()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java index 4bea1d79d9..812b062b31 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ExperienceCommand.java @@ -115,9 +115,7 @@ public void execute(ScriptEntry scriptEntry) { Boolean level = (Boolean) scriptEntry.getObject("level"); //Boolean silent = (Boolean) scriptEntry.getObject("silent"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, name, db("Type", type.toString()) - + db("Quantity", level ? quantity + " levels" : quantity) - + db("Player", Utilities.getEntryPlayer(scriptEntry).getName())); + Debug.report(scriptEntry, name, db("type", type.toString()), db("quantity", level ? quantity + " levels" : quantity), db("player", Utilities.getEntryPlayer(scriptEntry))); } Player player = Utilities.getEntryPlayer(scriptEntry).getPlayerEntity(); switch (type) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/FakeSpawnCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/FakeSpawnCommand.java index 7cf5ad867f..8c43dd7d1e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/FakeSpawnCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/FakeSpawnCommand.java @@ -114,9 +114,7 @@ public void execute(ScriptEntry scriptEntry) { DurationTag duration = scriptEntry.getObjectTag("duration"); ElementTag cancel = scriptEntry.getElement("cancel"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), entity.debug() - + (cancel != null ? cancel.debug() : location.debug() + duration.debug()) - + db("players", players)); + Debug.report(scriptEntry, getName(), entity, cancel, location, duration, db("players", players)); } if (cancel != null && cancel.asBoolean()) { if (entity.isFake) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java index 1c28d52399..545b4a5764 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GlowCommand.java @@ -97,7 +97,7 @@ public void execute(ScriptEntry scriptEntry) { final ArrayList entities = (ArrayList) scriptEntry.getObject("entities"); ElementTag glowing = scriptEntry.getElement("glowing"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("entities", entities) + glowing.debug()); + Debug.report(scriptEntry, getName(), db("entities", entities), glowing); } boolean shouldGlow = glowing.asBoolean(); final UUID puuid = Utilities.getEntryPlayer(scriptEntry).getUUID(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java index 223235c9c8..cd01041948 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/GroupCommand.java @@ -94,7 +94,7 @@ public void execute(ScriptEntry scriptEntry) { WorldTag world = scriptEntry.getObjectTag("world"); ElementTag group = scriptEntry.getElement("group"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action.debug() + (world != null ? world.debug() : "") + group.debug()); + Debug.report(scriptEntry, getName(), action, world, group); } World bukkitWorld = null; if (world != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java index 90c31a9a9e..d54e64d28d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ItemCooldownCommand.java @@ -59,9 +59,7 @@ public void addCustomTabCompletions(String arg, Consumer addOne) { @Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { - for (Argument arg : scriptEntry) { - if (!scriptEntry.hasObject("materials") && (arg.matchesArgumentType(MaterialTag.class) || arg.matchesArgumentType(ListTag.class))) { @@ -76,32 +74,24 @@ else if (!scriptEntry.hasObject("duration") arg.reportUnhandled(); } } - if (!scriptEntry.hasObject("materials")) { throw new InvalidArgumentsException("Missing materials argument!"); } - scriptEntry.defaultObject("duration", new DurationTag(1)); } @Override public void execute(ScriptEntry scriptEntry) { - ArrayList materials = (ArrayList) scriptEntry.getObject("materials"); DurationTag duration = scriptEntry.getObjectTag("duration"); PlayerTag player = Utilities.getEntryPlayer(scriptEntry); - if (player == null) { Debug.echoError("Invalid linked player."); return; } - if (scriptEntry.dbCallShouldDebug()) { - - Debug.report(scriptEntry, getName(), db("materials", materials) + duration.debug()); - + Debug.report(scriptEntry, getName(), db("materials", materials), duration); } - for (MaterialTag mat : materials) { player.getPlayerEntity().setCooldown(mat.getMaterial(), duration.getTicksAsInt()); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java index ec3df36b70..5ae3f0399f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/KickCommand.java @@ -70,9 +70,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag reason = scriptEntry.getElement("reason"); List targets = (List) scriptEntry.getObject("targets"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("targets", targets) + - reason.debug()); + Debug.report(scriptEntry, getName(), db("targets", targets), reason); } for (PlayerTag player : targets) { if (player.isValid() && player.isOnline()) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java index fe7a92e0d1..a0c31d7d4d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/MoneyCommand.java @@ -115,7 +115,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag quantity = scriptEntry.getElement("quantity"); List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("Player(s)", players) + action.debug() + quantity.debug()); + Debug.report(scriptEntry, getName(), db("Player(s)", players), action, quantity); } Economy eco = Depends.economy; double amt = quantity.asDouble(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java index 51247d5fa4..47eb4c64ca 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OpenTradesCommand.java @@ -63,9 +63,7 @@ public OpenTradesCommand() { // --> public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { - for (Argument arg : scriptEntry) { - if (!scriptEntry.hasObject("trades") && !scriptEntry.hasObject("entity") && arg.matchesArgumentList(TradeTag.class)) { @@ -86,35 +84,22 @@ else if (arg.matchesPrefix("players") else { arg.reportUnhandled(); } - } - if (!scriptEntry.hasObject("trades") && !scriptEntry.hasObject("entity")) { throw new InvalidArgumentsException("Must specify a villager entity or a list of trades for the player(s) to trade with!"); } - scriptEntry.defaultObject("title", new ElementTag("")) .defaultObject("players", Collections.singletonList(Utilities.getEntryPlayer(scriptEntry))); - } public void execute(ScriptEntry scriptEntry) { - - String title = scriptEntry.getElement("title").asString(); + ElementTag title = scriptEntry.getElement("title"); EntityTag entity = scriptEntry.getObjectTag("entity"); List trades = (List) scriptEntry.getObject("trades"); List players = (List) scriptEntry.getObject("players"); - if (scriptEntry.dbCallShouldDebug()) { - - Debug.report(scriptEntry, getName(), - (entity != null ? db("entity", entity) : "") - + (trades != null ? db("trades", trades) : "") - + (title.isEmpty() ? db("title", title) : "") - + db("players", players)); - + Debug.report(scriptEntry, getName(), entity, db("trades", trades), title, db("players", players)); } - if (entity != null) { if (players.size() > 1) { Debug.echoError("No more than one player can access the same entity!"); @@ -133,15 +118,13 @@ public void execute(ScriptEntry scriptEntry) { Debug.echoError("The specified entity isn't a merchant!"); return; } - List recipes = new ArrayList<>(); for (TradeTag trade : trades) { recipes.add(trade.getRecipe()); } - for (PlayerTag player : players) { if (player.isValid() && player.isOnline()) { - Merchant merchant = Bukkit.createMerchant(title); + Merchant merchant = Bukkit.createMerchant(title.asString()); merchant.setRecipes(recipes); player.getPlayerEntity().openMerchant(merchant, true); } diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java index 46f1d574eb..6a268b6367 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/OxygenCommand.java @@ -85,7 +85,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag mode = scriptEntry.getElement("mode"); ElementTag amount = scriptEntry.getElement("amount"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), type.debug() + mode.debug() + amount.debug()); + Debug.report(scriptEntry, getName(), type, mode, amount); } PlayerTag player = Utilities.getEntryPlayer(scriptEntry); switch (Type.valueOf(type.asString().toUpperCase())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java index f85a430d9c..9be2440df4 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/PermissionCommand.java @@ -101,8 +101,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag group = scriptEntry.getElement("group"); WorldTag world = scriptEntry.getObjectTag("world"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action.debug() + permission.debug() - + (group != null ? group.debug() : "") + (world != null ? world.debug() : "")); + Debug.report(scriptEntry, getName(), action, permission, group, world); } World bukkitWorld = null; if (world != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java index 0921f371d3..d21997ed8f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/ShowFakeCommand.java @@ -139,10 +139,7 @@ public void execute(ScriptEntry scriptEntry) { List locations = (List) scriptEntry.getObject("locations"); List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), duration.debug() + cancel.debug() - + (materials != null ? db("materials", materials) : "") - + db("locations", locations) - + db("players", players)); + Debug.report(scriptEntry, getName(), duration, cancel, db("materials", materials), db("locations", locations), db("players", players)); } boolean shouldCancel = cancel.asBoolean(); int i = 0; diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java index ffed039597..9b2261bc70 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/SidebarCommand.java @@ -208,11 +208,11 @@ public void execute(ScriptEntry scriptEntry) { if (elStart != null) { perStart = elStart.asString(); } - debug = (elTitle != null ? elTitle.debug() : "") + + debug = scriptEntry.dbCallShouldDebug() ? ((elTitle != null ? elTitle.debug() : "") + (elScores != null ? elScores.debug() : "") + (elValue != null ? elValue.debug() : "") + (elIncrement != null ? elIncrement.debug() : "") + - (elStart != null ? elStart.debug() : ""); + (elStart != null ? elStart.debug() : "")) : null; } else { BukkitTagContext context = (BukkitTagContext) scriptEntry.getContext(); @@ -231,14 +231,14 @@ public void execute(ScriptEntry scriptEntry) { if (elStart != null) { start = new ElementTag(TagManager.tag(elStart.asString(), context)); } - debug = (title != null ? title.debug() : "") + + debug = scriptEntry.dbCallShouldDebug() ? ((title != null ? title.debug() : "") + (scores != null ? db("scores", scores) : "") + (value != null ? db("value", value) : "") + (increment != null ? increment.debug() : "") + - (start != null ? start.debug() : ""); + (start != null ? start.debug() : "")) : null; } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action.debug() + debug + db("players", players.debuggable())); + Debug.report(scriptEntry, getName(), action, debug, db("players", players)); } switch (Action.valueOf(action.asString())) { case ADD: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java index aa8c150b06..5b314f6536 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/StatisticCommand.java @@ -139,8 +139,7 @@ public void execute(ScriptEntry scriptEntry) { MaterialTag material = scriptEntry.getObjectTag("material"); EntityTag entity = scriptEntry.getObjectTag("entity"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action.debug() + statistic.debug() + amount.debug() + players.debug() - + (material != null ? material.debug() : entity != null ? entity.debug() : "")); + Debug.report(scriptEntry, getName(), action, statistic, amount, players, material, entity); } Action act = Action.valueOf(action.asString().toUpperCase()); Statistic stat = Statistic.valueOf(statistic.asString().toUpperCase()); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java index 0d15e0c032..64dc3490b2 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TeamCommand.java @@ -150,15 +150,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag status = scriptEntry.getElement("status"); ElementTag color = scriptEntry.getElement("color"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - id.debug() + - name.debug() + - (add != null ? add.debug() : "") + - (remove != null ? remove.debug() : "") + - (prefix != null ? prefix.debug() : "") + - (suffix != null ? suffix.debug() : "") + - (color != null ? color.debug() : "") + - (option != null ? option.debug() + status.debug() : "")); + Debug.report(scriptEntry, getName(), id, name, add, remove, prefix, suffix, color, option, status); } Scoreboard board; if (id.asString().equalsIgnoreCase("main")) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java index 65f7da54f8..95fc01cf4c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/player/TitleCommand.java @@ -115,14 +115,7 @@ public void execute(ScriptEntry scriptEntry) { subtitle = TagManager.tag(subtitle, context); } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("title", title) - + db("subtitle", subtitle) - + fade_in.debug() - + stay.debug() - + fade_out.debug() - + db("targets", targets) - + (perPlayerObj != null ? perPlayerObj.debug() : "")); + Debug.report(scriptEntry, getName(), db("title", title), db("subtitle", subtitle), fade_in, stay, fade_out, db("targets", targets), perPlayerObj); } for (PlayerTag player : targets) { if (player != null) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java index da59917b1d..a1ce20ed2d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/AnnounceCommand.java @@ -120,11 +120,7 @@ public void execute(ScriptEntry scriptEntry) { FormatScriptContainer format = (FormatScriptContainer) scriptEntry.getObject("format"); ElementTag flag = scriptEntry.getElement("flag"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("Message", text) - + (format != null ? db("Format", format.getName()) : "") - + db("Type", type.name()) - + (flag != null ? db("Flag_Name", flag) : "")); + Debug.report(scriptEntry, getName(), db("message", text), (format != null ? db("format", format.getName()) : ""), db("type", type.name()), flag); } String message = format != null ? format.getFormattedText(text.asString(), scriptEntry) : text.asString(); // Use Bukkit to broadcast the message to everybody in the server. diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java index 4fa393ce85..db039fba73 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/BanCommand.java @@ -144,7 +144,7 @@ public void execute(ScriptEntry scriptEntry) { expiration = new Date(new DurationTag(System.currentTimeMillis() / 50 + duration.getTicks()).getTicks() * 50); } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action, (targets != null ? db("targets", targets) : ""), addresses, reason, duration, source); + Debug.report(scriptEntry, getName(), action, db("targets", targets), addresses, reason, duration, source); } Actions banAction = Actions.valueOf(action.toString().toUpperCase()); switch (banAction) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java index 8fbdf4c386..b0ca6abe9d 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/server/ScoreboardCommand.java @@ -213,7 +213,7 @@ public void execute(final ScriptEntry scriptEntry) { displaySlot = new ElementTag("sidebar"); } if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), action, id, viewers != null ? db("viewers", viewers.toString()) : "", objective, lines, score, objective, displaySlot, criteria, displayName, renderType); + Debug.report(scriptEntry, getName(), action, id, db("viewers", viewers), objective, lines, score, objective, displaySlot, criteria, displayName, renderType); } Scoreboard board = null; // Get the main scoreboard by default diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AdjustBlockCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AdjustBlockCommand.java index acc9b23437..6cf53dc4e5 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AdjustBlockCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AdjustBlockCommand.java @@ -106,11 +106,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag noPhysics = scriptEntry.getElement("no_physics"); List locations = (List) scriptEntry.getObject("locations"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - db("locations", locations) - + mechanismName.debug() - + (noPhysics == null ? "" : noPhysics.debug()) - + (value == null ? "" : value.debug())); + Debug.report(scriptEntry, getName(), db("locations", locations), mechanismName, noPhysics, value); } boolean doPhysics = noPhysics == null || !noPhysics.asBoolean(); for (LocationTag location : locations) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java index d7b77738b6..4576778192 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/AnimateChestCommand.java @@ -132,11 +132,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag sound = scriptEntry.getElement("sound"); List players = (List) scriptEntry.getObject("players"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), location.debug() - + db("block type", location.getBlock().getType().name()) - + action.debug() - + sound.debug() - + db("players", players.toString())); + Debug.report(scriptEntry, getName(), location, db("block type", location.getBlock().getType().name()), action, sound, db("players", players)); } PacketHelper packetHelper = NMSHandler.getPacketHelper(); switch (ChestAction.valueOf(action.asString().toUpperCase())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java index c2466362ee..9186fbe8a3 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/DropCommand.java @@ -155,12 +155,7 @@ public void execute(ScriptEntry scriptEntry) { EntityTag entity = scriptEntry.getObjectTag("entity"); DurationTag delay = scriptEntry.getObjectTag("delay"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), - action.debug() + location.debug() + quantity.debug() - + (items != null ? db("items", items) : "") - + (entity != null ? entity.debug() : "") - + (speed != null ? speed.debug() : "") - + (delay != null ? delay.debug() : "")); + Debug.report(scriptEntry, getName(), action, location, quantity, db("items", items), entity, speed, delay); } ListTag entityList = new ListTag(); switch (Action.valueOf(action.asString())) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java index c3ddbcb0cd..a344911101 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/FireworkCommand.java @@ -142,9 +142,7 @@ public void execute(final ScriptEntry scriptEntry) { List fade = (List) scriptEntry.getObject("fade"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), location, type, power, (flicker ? db("flicker", true) : ""), - (trail ? db("trail", true) : ""), - db("primary colors", primary), - (fade != null ? db("fade colors", fade) : "")); + (trail ? db("trail", true) : ""), db("primary colors", primary), db("fade colors", fade)); } Firework firework = location.getWorld().spawn(location, Firework.class); FireworkMeta fireworkMeta = firework.getFireworkMeta(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java index d0e54354b1..7aac27f70b 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/MidiCommand.java @@ -129,12 +129,7 @@ public void execute(final ScriptEntry scriptEntry) { float tempo = scriptEntry.getElement("tempo").asFloat(); float volume = scriptEntry.getElement("volume").asFloat(); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (cancel ? db("cancel", cancel) : "") + - (file != null ? db("file", file.getPath()) : "") + - (entities != null ? db("entities", entities.toString()) : "") + - (location != null ? location.debug() : "") + - db("tempo", tempo) + - db("volume", volume)); + Debug.report(scriptEntry, getName(), (cancel ? db("cancel", true) : ""), db("file", file.getPath()), db("entities", entities), location, db("tempo", tempo), db("volume", volume)); } // Play the midi if (!cancel) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java index 536aa03bba..674268438e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlayEffectCommand.java @@ -223,18 +223,8 @@ public void execute(ScriptEntry scriptEntry) { ElementTag special_data = scriptEntry.getElement("special_data"); LocationTag velocity = scriptEntry.getObjectTag("velocity"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (effect != null ? db("effect", effect.name()) : - particleEffect != null ? db("special effect", particleEffect.getName()) : - (iconcrack != null ? iconcrack.debug() : "")) + - db("locations", locations.toString()) + - (targets != null ? db("targets", targets.toString()) : "") + - radius.debug() + - data.debug() + - quantity.debug() + - offset.debug() + - (special_data != null ? special_data.debug() : "") + - (velocity != null ? velocity.debug() : "") + - (should_offset ? db("note", "Location will be offset 1 block-height upward (see documentation)") : "")); + Debug.report(scriptEntry, getName(), (effect != null ? db("effect", effect.name()) : particleEffect != null ? db("special effect", particleEffect.getName()) : (iconcrack != null ? iconcrack.debug() : "")), + db("locations", locations), db("targets", targets), radius, data, quantity, offset, special_data, velocity, (should_offset ? db("note", "Location will be offset 1 block-height upward (see documentation)") : "")); } for (LocationTag location : locations) { if (should_offset) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java index d311a277df..1c1b20b8cb 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/PlaySoundCommand.java @@ -135,8 +135,7 @@ public void execute(ScriptEntry scriptEntry) { ElementTag custom = scriptEntry.getElement("custom"); ElementTag sound_category = scriptEntry.getElement("sound_category"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), (locations != null ? db("locations", locations) : ""), - (players != null ? db("entities", players) : ""), soundElement, volumeElement, pitchElement, custom); + Debug.report(scriptEntry, getName(), db("locations", locations), db("entities", players), soundElement, volumeElement, pitchElement, custom); } String sound = soundElement.asString(); float volume = volumeElement.asFloat(); diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java index 07adab6783..4fe2997671 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WeatherCommand.java @@ -80,9 +80,7 @@ private enum Value {SUNNY, STORM, THUNDER, RESET} @Override public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { - for (Argument arg : scriptEntry) { - if (!scriptEntry.hasObject("type") && arg.matchesEnum(Type.values())) { scriptEntry.addObject("type", Type.valueOf(arg.getValue().toUpperCase())); @@ -104,15 +102,10 @@ else if (!scriptEntry.hasObject("reset_after") arg.reportUnhandled(); } } - if (!scriptEntry.hasObject("value")) { throw new InvalidArgumentsException("Must specify a value!"); } - scriptEntry.defaultObject("type", Type.GLOBAL); - - // If the world has not been specified, try to use the NPC's or player's - // world, or default to "world" if necessary scriptEntry.defaultObject("world", Utilities.entryDefaultWorld(scriptEntry, false)); } @@ -124,15 +117,11 @@ public void execute(ScriptEntry scriptEntry) { WorldTag world = scriptEntry.getObjectTag("world"); Type type = (Type) scriptEntry.getObject("type"); DurationTag resetAfter = scriptEntry.getObjectTag("reset_after"); - if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), db("type", type.name()) - + (type.name().equalsIgnoreCase("player") ? db("player", Utilities.getEntryPlayer(scriptEntry)) : "") - + (type.name().equalsIgnoreCase("global") ? db("world", world) : "") - + (resetAfter != null ? resetAfter.debug() : "") - + db("value", value)); + Debug.report(scriptEntry, getName(), db("type", type.name()), + (type.name().equalsIgnoreCase("player") ? db("player", Utilities.getEntryPlayer(scriptEntry)) : ""), + (type.name().equalsIgnoreCase("global") ? db("world", world) : ""), resetAfter, db("value", value)); } - if (type.equals(Type.GLOBAL)) { switch (value) { case SUNNY: diff --git a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java index d92114dc63..64b70198ec 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java +++ b/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/world/WorldBorderCommand.java @@ -155,9 +155,7 @@ public void execute(ScriptEntry scriptEntry) { DurationTag warningtime = scriptEntry.getObjectTag("warningtime"); ElementTag reset = scriptEntry.getObjectTag("reset"); if (scriptEntry.dbCallShouldDebug()) { - Debug.report(scriptEntry, getName(), world, (players != null ? db("Player(s)", players) : ""), - center, size, currSize, damage, damagebuffer, warningdistance, warningtime, duration, reset); - + Debug.report(scriptEntry, getName(), world, db("players", players), center, size, currSize, damage, damagebuffer, warningdistance, warningtime, duration, reset); } if (players != null) { if (reset.asBoolean()) {