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

Dieser Commit ist enthalten in:
Wizjany 2011-09-17 01:33:42 -04:00
Ursprung d6ed17dd9d
Commit b10498b9c7
3 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen

Datei anzeigen

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

Datei anzeigen

@ -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;
}
} }
} }

Datei anzeigen

@ -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;
} }