From b10498b9c7858c7acf865a7d16b91dd843cd1434 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Sat, 17 Sep 2011 01:33:42 -0400 Subject: [PATCH] Added 'xp' as a parameter of the /remove command to remove experience orbs. --- src/main/java/com/sk89q/worldedit/EntityType.java | 1 + src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 6 ++++++ .../java/com/sk89q/worldedit/commands/UtilityCommands.java | 4 +++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/EntityType.java b/src/main/java/com/sk89q/worldedit/EntityType.java index 128de27c0..3f5ece54c 100644 --- a/src/main/java/com/sk89q/worldedit/EntityType.java +++ b/src/main/java/com/sk89q/worldedit/EntityType.java @@ -10,4 +10,5 @@ public enum EntityType { BOATS, MINECARTS, TNT, + XP_ORBS } \ No newline at end of file diff --git a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 2584ee4c3..3da9d699e 100644 --- a/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -28,6 +28,7 @@ import org.bukkit.entity.Arrow; import org.bukkit.entity.Boat; import org.bukkit.entity.Creature; import org.bukkit.entity.Entity; +import org.bukkit.entity.ExperienceOrb; import org.bukkit.entity.Ghast; import org.bukkit.entity.Item; import org.bukkit.entity.LivingEntity; @@ -535,6 +536,11 @@ public class BukkitWorld extends LocalWorld { ent.remove(); ++num; } + } else if (type == EntityType.XP_ORBS) { + if (ent instanceof ExperienceOrb) { + ent.remove(); + ++num; + } } } diff --git a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java index 96642daab..08539f283 100644 --- a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java @@ -404,8 +404,10 @@ public class UtilityCommands { type = EntityType.MINECARTS; } else if (typeStr.matches("tnt")) { type = EntityType.TNT; + } else if (typeStr.matches("xp")) { + type = EntityType.XP_ORBS; } else { - player.printError("Acceptable types: arrows, items, paintings, boats, minecarts, tnt"); + player.printError("Acceptable types: arrows, items, paintings, boats, minecarts, tnt, xp"); return; }