// }
// String quantity = inspected.get("quantity");
// if (quantity == null) {
// quantity = "1";
// }
new ItemLogger().destroy(player, inspected.getContainerSlot(), inspected, "admin");
}
String slotname = inspected.getContainerSlot().getName();
int objectID = inspected.getID().getObjectID();
if (null != inspected.getContainerSlot().remove(inspected.getID())) {
if (slot instanceof Entity) {
((Entity) slot).notifyWorldAboutChanges();
}
player.sendPrivateText("Removed contained " + name + " " + clazz + " with ID " + objectID + " from " + slotname);
} else {
player.sendPrivateText("could not remove contained " + inspected + " " + clazz + " with ID " + objectID + " from " + slotname);
}
} else {
if (inspected instanceof Player) {
final String text = "You can't remove players";
player.sendPrivateText(text);
return;
}
if (inspected instanceof SpeakerNPC) {
final String text = "You can't remove SpeakerNPCs";
player.sendPrivateText(text);
return;
}
if (inspected instanceof Portal) {
final String text = "You can't remove portals. Try blocking it with a few of /script AdminSign.class.";
player.sendPrivateText(text);
return;
}
final StendhalRPZone zone = inspected.getZone();
if (inspected instanceof RPEntity) {
if (inspected instanceof Creature) {
// *destroyed creatures should not drop items
((Creature) inspected).clearDropItemList();
}
((RPEntity) inspected).onDead(player);
} else if ((inspected instanceof Item) || (inspected instanceof FlowerGrower) || (inspected instanceof Blood) || (inspected instanceof Corpse)) {
// items should be added to itemlog as well, to help tracing problems
if (inspected instanceof Item) {
String quantity = inspected.get("quantity");
if (quantity == null) {
quantity = "1";
}
new ItemLogger().destroy(player, null, inspected, "admin");
}
zone.remove(inspected);
} else {
player.sendPrivateText("You can't remove this type of entity");
return;