From 4f3198b1bd453107d4f388c4f133d0fe68e33c56 Mon Sep 17 00:00:00 2001 From: sk89q Date: Mon, 20 Jun 2011 19:35:14 -0700 Subject: [PATCH] wiz makes a good point -- PROBABLY should not delete players. --- .../com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java | 4 +++- .../com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java | 4 +++- .../com/sk89q/worldguard/bukkit/commands/ToggleCommands.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java index 1783e685..377213de 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardPlayerListener.java @@ -125,7 +125,9 @@ public void onPlayerJoin(PlayerJoinEvent event) { for (Entity entity : player.getWorld().getEntities()) { if (entity instanceof Item - || (entity instanceof LivingEntity && !(entity instanceof Tameable))) { + || (entity instanceof LivingEntity + && !(entity instanceof Tameable) + && !(entity instanceof Player))) { entity.remove(); removed++; } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java index 97202bf6..4d16f3a4 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/WorldGuardWorldListener.java @@ -51,7 +51,9 @@ public void onChunkLoad(ChunkLoadEvent event) { for (Entity entity : event.getChunk().getEntities()) { if (entity instanceof Item - || (entity instanceof LivingEntity && !(entity instanceof Tameable))) { + || (entity instanceof LivingEntity + && !(entity instanceof Tameable) + && !(entity instanceof Player))) { entity.remove(); removed++; } diff --git a/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java b/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java index fad855a1..e86c0ccc 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/commands/ToggleCommands.java @@ -116,7 +116,9 @@ public static void stopLag(CommandContext args, WorldGuardPlugin plugin, for (Entity entity : world.getEntities()) { if (entity instanceof Item - || (entity instanceof LivingEntity && !(entity instanceof Tameable))) { + || (entity instanceof LivingEntity + && !(entity instanceof Tameable) + && !(entity instanceof Player))) { entity.remove(); removed++; }