Added 'xp' as a parameter of the /remove command to remove experience orbs.

This commit is contained in:
Wizjany 2011-09-17 01:33:42 -04:00
parent d6ed17dd9d
commit b10498b9c7
3 changed files with 10 additions and 1 deletions

View File

@ -10,4 +10,5 @@ public enum EntityType {
BOATS, BOATS,
MINECARTS, MINECARTS,
TNT, TNT,
XP_ORBS
} }

View File

@ -28,6 +28,7 @@ import org.bukkit.entity.Arrow;
import org.bukkit.entity.Boat; import org.bukkit.entity.Boat;
import org.bukkit.entity.Creature; import org.bukkit.entity.Creature;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.ExperienceOrb;
import org.bukkit.entity.Ghast; import org.bukkit.entity.Ghast;
import org.bukkit.entity.Item; import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
@ -535,6 +536,11 @@ public class BukkitWorld extends LocalWorld {
ent.remove(); ent.remove();
++num; ++num;
} }
} else if (type == EntityType.XP_ORBS) {
if (ent instanceof ExperienceOrb) {
ent.remove();
++num;
}
} }
} }

View File

@ -404,8 +404,10 @@ public class UtilityCommands {
type = EntityType.MINECARTS; type = EntityType.MINECARTS;
} else if (typeStr.matches("tnt")) { } else if (typeStr.matches("tnt")) {
type = EntityType.TNT; type = EntityType.TNT;
} else if (typeStr.matches("xp")) {
type = EntityType.XP_ORBS;
} else { } else {
player.printError("Acceptable types: arrows, items, paintings, boats, minecarts, tnt"); player.printError("Acceptable types: arrows, items, paintings, boats, minecarts, tnt, xp");
return; return;
} }