use of com.sk89q.jnbt.LongTag in project FastAsyncWorldEdit by IntellectualSites.
the class MutableEntityChange method delete.
@SuppressWarnings({ "unchecked" })
public void delete(UndoContext context) {
Map<String, Tag> map = tag.getValue();
long most;
long least;
if (map.containsKey("UUIDMost")) {
most = ((LongTag) map.get("UUIDMost")).getValue();
least = ((LongTag) map.get("UUIDLeast")).getValue();
} else if (map.containsKey("PersistentIDMSB")) {
most = ((LongTag) map.get("PersistentIDMSB")).getValue();
least = ((LongTag) map.get("PersistentIDLSB")).getValue();
} else {
LOGGER.info("Skipping entity without uuid.");
return;
}
List<DoubleTag> pos = (List<DoubleTag>) map.get("Pos").getValue();
int x = MathMan.roundInt(pos.get(0).getValue());
int y = MathMan.roundInt(pos.get(1).getValue());
int z = MathMan.roundInt(pos.get(2).getValue());
UUID uuid = new UUID(most, least);
context.getExtent().removeEntity(x, y, z, uuid);
}