diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java index c50fe50e..bfc7feda 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/PurgeCommand.java @@ -80,20 +80,10 @@ public class PurgeCommand extends MultiverseCommand { if (deathName.equalsIgnoreCase("all") || deathName.equalsIgnoreCase("animals") || deathName.equalsIgnoreCase("monsters")) { thingsToKill.add(deathName.toUpperCase()); } else { - for (String d :deathName.toUpperCase().split(",")) { - if(d.equalsIgnoreCase("dragon")){ //could be replaced with a Map(Hash?) to allow for all mobs to have multiple keywords - thingsToKill.add("ENDERDRAGON");// note UpperCase needed on this literal - } - else{ - thingsToKill.add(d); - } - } + Collections.addAll(thingsToKill, deathName.toUpperCase().split(",")); } for (MultiverseWorld w : worldsToRemoveEntitiesFrom) { purger.purgeWorld(sender, w, thingsToKill, false, false); } - - return; } - } diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java index 39552905..8489869e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/VersionCommand.java @@ -86,7 +86,6 @@ public class VersionCommand extends MultiverseCommand { data += "&" + URLEncoder.encode("api_paste_code", "UTF-8") + "=" + URLEncoder.encode(this.pasteBinBuffer, "UTF-8"); data += "&" + URLEncoder.encode("api_paste_private", "UTF-8") + "=" + URLEncoder.encode("1", "UTF-8"); data += "&" + URLEncoder.encode("api_paste_format", "UTF-8") + "=" + URLEncoder.encode("yaml", "UTF-8"); - DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); Date date = new Date(); // We're out of //data += "&" + URLEncoder.encode("api_paste_name", "UTF-8") + "=" + URLEncoder.encode("Multiverse 2 Dump " + dateFormat.format(date), "UTF-8"); diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 2b33fd97..207b6a3a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -152,7 +152,12 @@ public class MVPlayerListener extends PlayerListener { // If the player was actually outside of the portal, adjust the from location if (event.getFrom().getWorld().getBlockAt(event.getFrom()).getType() != Material.PORTAL) { - event.setFrom(SafeTTeleporter.findPortalBlockNextTo(event.getFrom())); + Location newloc = SafeTTeleporter.findPortalBlockNextTo(event.getFrom()); + // TODO: Fix this. Currently, we only check for PORTAL blocks. I'll have to figure out what + // TODO: we want to do here. + if (newloc != null) { + event.setFrom(newloc); + } } MultiverseWorld fromWorld = this.worldManager.getMVWorld(event.getFrom().getWorld().getName()); MultiverseWorld toWorld = this.worldManager.getMVWorld(event.getTo().getWorld().getName()); diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/PurgeWorlds.java b/src/main/java/com/onarandombox/MultiverseCore/utils/PurgeWorlds.java index 54230e45..45174b3a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/PurgeWorlds.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/PurgeWorlds.java @@ -59,7 +59,7 @@ public class PurgeWorlds { return; } int entitiesKilled = 0; - for (Entity e : world.getEntities()){ + for (Entity e : world.getEntities()) { this.plugin.log(Level.FINEST, "Entity list (aval for purge) from WORLD < " + mvworld.getName() + " >: " + e.toString()); // Check against Monsters @@ -108,11 +108,10 @@ public class PurgeWorlds { */ private boolean killMonster(MultiverseWorld mvworld, Entity e, List creaturesToKill, boolean negate) { String entityName = ""; + //TODO: Fixme once either Rigby puts his awesome thing in OR Enderdragon gets a toString, OR both. if (e instanceof EnderDragon) { - this.plugin.log(Level.FINEST, "Found an enderdragon: " + e); - entityName = "ENDERDRAGON"; // Assumes that creaturesToKill contains the ENDERDRAGON keyword - } - else{ + entityName = "ENDERDRAGON"; + } else { entityName = e.toString().replaceAll("Craft", "").toUpperCase(); } if (e instanceof Slime || e instanceof Monster || e instanceof Ghast || e instanceof EnderDragon) {