diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/ExplodeCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/ExplodeCommand.java index 03cca90a7e..a3fd66b4f7 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/ExplodeCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/ExplodeCommand.java @@ -30,36 +30,36 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException // Location arg scriptEntry.addObject("location", arg.asType(dLocation.class)); } - - else if (!scriptEntry.hasObject("power") + + else if (!scriptEntry.hasObject("power") && arg.matchesPrimitive(aH.PrimitiveType.Float) && arg.matchesPrefix("power, p")) { // Add value scriptEntry.addObject("power", arg.asElement()); } - - else if (!scriptEntry.hasObject("breakblocks") - && arg.matches("breakblocks")) { - - scriptEntry.addObject("breakblocks", ""); - } - - else if (!scriptEntry.hasObject("fire") - && arg.matches("fire")) { - - scriptEntry.addObject("fire", ""); - } - - // Use default values if necessary - - scriptEntry.defaultObject("power", new Element(1.0)); - scriptEntry.defaultObject("location", - scriptEntry.hasNPC() ? scriptEntry.getNPC().getLocation() : null, - scriptEntry.hasPlayer() ? scriptEntry.getPlayer().getLocation() : null); - - if (!scriptEntry.hasObject("location")) { - throw new InvalidArgumentsException(Messages.ERROR_MISSING_OTHER, "LOCATION"); - } + + else if (!scriptEntry.hasObject("breakblocks") + && arg.matches("breakblocks")) { + + scriptEntry.addObject("breakblocks", ""); + } + + else if (!scriptEntry.hasObject("fire") + && arg.matches("fire")) { + + scriptEntry.addObject("fire", ""); + } + } + + // Use default values if necessary + + scriptEntry.defaultObject("power", new Element(1.0)); + scriptEntry.defaultObject("location", + scriptEntry.hasNPC() ? scriptEntry.getNPC().getLocation() : null, + scriptEntry.hasPlayer() ? scriptEntry.getPlayer().getLocation() : null); + + if (!scriptEntry.hasObject("location")) { + throw new InvalidArgumentsException(Messages.ERROR_MISSING_OTHER, "LOCATION"); } } @@ -74,13 +74,13 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept // Report to dB dB.report(getName(), - (aH.debugObj("location", location.toString()) + - aH.debugObj("power", power) + - aH.debugObj("breakblocks", breakblocks) + - aH.debugObj("fire", fire))); + (aH.debugObj("location", location.toString()) + + aH.debugObj("power", power) + + aH.debugObj("breakblocks", breakblocks) + + aH.debugObj("fire", fire))); location.getWorld().createExplosion - (location.getX(), location.getY(), location.getZ(), - power.asFloat(), fire, breakblocks); + (location.getX(), location.getY(), location.getZ(), + power.asFloat(), fire, breakblocks); } } \ No newline at end of file