diff --git a/src/main/java/net/aufdemrand/denizen/Denizen.java b/src/main/java/net/aufdemrand/denizen/Denizen.java index 337d4198a1..95b47587e9 100644 --- a/src/main/java/net/aufdemrand/denizen/Denizen.java +++ b/src/main/java/net/aufdemrand/denizen/Denizen.java @@ -168,7 +168,7 @@ public void onEnable() { dB.echoError("Your Denizen config file is from a different version. " + "Some settings will not be available unless you generate a new one. " + - "This is easily done by stopping the server, deleting the current config.yml file in the Denizen folder" + + "This is easily done by stopping the server, deleting the current config.yml file in the Denizen folder " + "and restarting the server."); } diff --git a/src/main/java/net/aufdemrand/denizen/objects/dMaterial.java b/src/main/java/net/aufdemrand/denizen/objects/dMaterial.java index ab07acd70b..3c42270bb2 100644 --- a/src/main/java/net/aufdemrand/denizen/objects/dMaterial.java +++ b/src/main/java/net/aufdemrand/denizen/objects/dMaterial.java @@ -11,7 +11,7 @@ public class dMaterial implements dObject { - final static Pattern materialPattern = Pattern.compile("(?:m@)?(\\w+)[:,]?(\\d+)?", Pattern.CASE_INSENSITIVE); + final static Pattern materialPattern = Pattern.compile("(?:m@)?(\\w+)[,:]?(\\d+)?", Pattern.CASE_INSENSITIVE); ////////////////// // OBJECT FETCHER diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/ShootCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/ShootCommand.java index 6f7754ecfc..58fa640729 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/ShootCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/ShootCommand.java @@ -188,7 +188,10 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept aH.debugObj("speed", speed) + aH.debugObj("duration", new Duration(maxRuns * 2)) : "") + (script != null ? aH.debugObj("script", script) : "")); - dList shot_entities = new dList(); + // Keep a dList of entities that can be called using %entities% + // later in the script queue + + dList entityList = new dList(); // Go through all the entities, spawning/teleporting and rotating them @@ -201,10 +204,11 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept entity.teleport(originLocation); } - // Add the spawned entity to the 'shot_entities' context - try { - shot_entities.add("e@" + entity.getBukkitEntity().getEntityId()); - } catch (Exception e) { dB.echoError("Entity failed to spawn!"); } + // Only add to entityList after the entities have been + // spawned, otherwise you'll get something like "e@skeleton" + // instead of "e@57" on it + + entityList.add(entity.toString()); Rotation.faceLocation(entity.getBukkitEntity(), destination); @@ -213,9 +217,10 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept } } - // Add shot_entities to context so that the specific entities created/spawned - // can be 'fetched'. - scriptEntry.addObject("shot_entities", shot_entities); + // Add entities to context so that the specific entities created/spawned + // can be fetched. + + scriptEntry.getResidingQueue().addDefinition("shot_entities", entityList.toString()); Position.mount(Conversion.convert(entities)); diff --git a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/SpawnCommand.java b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/SpawnCommand.java index 6b2afa018c..08e3d7eb79 100644 --- a/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/SpawnCommand.java +++ b/src/main/java/net/aufdemrand/denizen/scripts/commands/entity/SpawnCommand.java @@ -81,7 +81,7 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept // Keep a dList of entities that can be called using %entities% // later in the script queue - dList entityList = new dList(""); + dList entityList = new dList(); // Go through all the entities and spawn them or teleport them, // then set their targets if applicable @@ -105,8 +105,10 @@ public void execute(final ScriptEntry scriptEntry) throws CommandExecutionExcept entity.target(target.getLivingEntity()); } } - - - + + // Add entities to context so that the specific entities created/spawned + // can be fetched. + + scriptEntry.getResidingQueue().addDefinition("spawned_entities", entityList.toString()); } }