diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/BukkitCommandRegistry.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/BukkitCommandRegistry.java index f0de87e513..9d94315433 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/BukkitCommandRegistry.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/BukkitCommandRegistry.java @@ -1891,7 +1891,7 @@ public void registerCoreMembers() { // <--[command] // @Name PlayEffect - // @Syntax playeffect [|...] [effect:] (data:<#.#>) (visibility:<#.#>) (qty:<#>) (offset:<#.#>) (targets:|...) + // @Syntax playeffect [|...] [effect:] (data:<#.#>) (visibility:<#.#>) (qty:<#>) (offset:<#.#>,<#.#>,<#.#>) (targets:|...) // @Required 2 // @Stable stable // @Short Plays a visible or audible effect at the location. @@ -1906,7 +1906,7 @@ public void registerCoreMembers() { // TODO: Document Command Details // --> registerCoreMember(PlayEffectCommand.class, - "PLAYEFFECT", "playeffect [|...] [effect:] (data:<#.#>) (visibility:<#.#>) (qty:<#>) (offset:<#.#>) (targets:|...)", 2); + "PLAYEFFECT", "playeffect [|...] [effect:] (data:<#.#>) (visibility:<#.#>) (qty:<#>) (offset:<#.#>,<#.#>,<#.#>) (targets:|...)", 2); // <--[command] diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/WalkCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/WalkCommand.java index 9074905d9c..8b71f6a01f 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/WalkCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/WalkCommand.java @@ -99,7 +99,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { // Debug the execution - dB.report(scriptEntry, getName(), loc.debug() + dB.report(scriptEntry, getName(), (loc!= null ? loc.debug() : "") + (speed != null ? speed.debug() : "") + (auto_range != null ? auto_range.debug() : "") + (radius != null ? radius.debug() : "") diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/PlayEffectCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/PlayEffectCommand.java index 516e41a021..9d37b136f0 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/world/PlayEffectCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/world/PlayEffectCommand.java @@ -161,7 +161,15 @@ else if (!scriptEntry.hasObject("offset") && arg.matchesPrimitive(aH.PrimitiveType.Double) && arg.matchesPrefix("offset", "o")) { - scriptEntry.addObject("offset", arg.asElement()); + double offset = arg.asElement().asDouble(); + scriptEntry.addObject("offset", new dLocation(null, offset, offset, offset)); + } + + else if (!scriptEntry.hasObject("offset") + && arg.matchesArgumentType(dLocation.class) + && arg.matchesPrefix("offset", "o")) { + + scriptEntry.addObject("offset", arg.asType(dLocation.class)); } else if (!scriptEntry.hasObject("targets") @@ -182,7 +190,7 @@ else if (!scriptEntry.hasObject("targets") scriptEntry.defaultObject("data", new Element(0)); scriptEntry.defaultObject("radius", new Element(15)); scriptEntry.defaultObject("qty", new Element(1)); - scriptEntry.defaultObject("offset", new Element(0.5)); + scriptEntry.defaultObject("offset", new dLocation(null, 0.5, 0.5, 0.5)); // Check to make sure required arguments have been filled @@ -207,7 +215,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { Element radius = scriptEntry.getElement("radius"); Element data = scriptEntry.getElement("data"); Element qty = scriptEntry.getElement("qty"); - Element offset = scriptEntry.getElement("offset"); + dLocation offset = scriptEntry.getdObject("offset"); // Report to dB dB.report(scriptEntry, getName(), (effect != null ? aH.debugObj("effect", effect.name()) : @@ -218,8 +226,7 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { radius.debug() + data.debug() + qty.debug() + - offset.debug() + - (effect != null ? "" : offset.debug())); + offset.debug()); for (dLocation location : locations) { // Slightly increase the location's Y so effects don't seem to come out of the ground @@ -241,7 +248,9 @@ public void execute(ScriptEntry scriptEntry) throws CommandExecutionException { // Play a ParticleEffect else if (particleEffect != null) { - float os = offset.asFloat(); + float osX = (float) offset.getX(); + float osY = (float) offset.getY(); + float osZ = (float) offset.getZ(); List players = new ArrayList(); if (targets == null) { float rad = radius.asFloat(); @@ -256,7 +265,7 @@ else if (particleEffect != null) { if (player.isValid() && player.isOnline()) players.add(player.getPlayerEntity()); } PacketPlayOutWorldParticles o = new PacketPlayOutWorldParticles(particleEffect.effect, false, (float) location.getX(), - (float) location.getY(), (float) location.getZ(), os, os, os, data.asFloat(), qty.asInt()); + (float) location.getY(), (float) location.getZ(), osX, osY, osZ, data.asFloat(), qty.asInt()); for (Player player : players) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(o); } @@ -264,7 +273,9 @@ else if (particleEffect != null) { // Play an iconcrack (item break) effect else { - float os = offset.asFloat(); + float osX = (float) offset.getX(); + float osY = (float) offset.getY(); + float osZ = (float) offset.getZ(); List players = new ArrayList(); if (targets == null) { float rad = radius.asFloat(); @@ -279,7 +290,7 @@ else if (particleEffect != null) { if (player.isValid() && player.isOnline()) players.add(player.getPlayerEntity()); } PacketPlayOutWorldParticles o = new PacketPlayOutWorldParticles(EnumParticle.ITEM_CRACK, false, (float) location.getX(), - (float) location.getY(), (float) location.getZ(), os, os, os, data.asFloat(), qty.asInt(), + (float) location.getY(), (float) location.getZ(), osX, osY, osZ, data.asFloat(), qty.asInt(), iconcrack.asInt(), iconcrack.asInt()); // TODO: ??? for (Player player : players) { ((CraftPlayer) player).getHandle().playerConnection.sendPacket(o);