From fecc64eafb224b5711168d615ca3e064a2ee135a Mon Sep 17 00:00:00 2001 From: sk89q Date: Sun, 1 May 2011 18:17:52 -0700 Subject: [PATCH] Nailed the IllegalAccessException (thanks to lechd). --- .../sk89q/worldedit/bukkit/BukkitWorld.java | 69 ++++++++----------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 8e6431099..4dbc39be3 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -434,45 +434,36 @@ public int removeEntities(EntityType type, Vector origin, int radius) { continue; } - switch (type) { - case ARROWS: - if (ent instanceof Arrow) { - ent.remove(); - num++; - } - break; - case BOATS: - if (ent instanceof Boat) { - ent.remove(); - num++; - } - break; - case ITEMS: - if (ent instanceof Item) { - ent.remove(); - num++; - } - break; - case MINECARTS: - if (ent instanceof Minecart) { - ent.remove(); - num++; - } - break; - case PAINTINGS: - if (ent instanceof Painting) { - ent.remove(); - num++; - } - break; - case TNT: - if (ent instanceof TNTPrimed) { - ent.remove(); - num++; - } - break; - default: - continue; + if (type == EntityType.ARROWS) { + if (ent instanceof Arrow) { + ent.remove(); + num++; + } + } else if (type == EntityType.BOATS) { + if (ent instanceof Boat) { + ent.remove(); + num++; + } + } else if (type == EntityType.ITEMS) { + if (ent instanceof Item) { + ent.remove(); + num++; + } + } else if (type == EntityType.MINECARTS) { + if (ent instanceof Minecart) { + ent.remove(); + num++; + } + } else if (type == EntityType.PAINTINGS) { + if (ent instanceof Painting) { + ent.remove(); + num++; + } + } else if (type == EntityType.TNT) { + if (ent instanceof TNTPrimed) { + ent.remove(); + num++; + } } }