double x = n.model.getBoundingBox(n.getGridX(), n.getGridY(), n.getZ()).getCenterX();
double y = n.model.getBoundingBox(n.getGridX(), n.getGridY(), n.getZ()).getCenterY();
mouse.move((int) x, (int) y);
This isn't going to work for moving entities tho, or with an async moving camera. Standard entity mousedestinations update the mouse path during the movement, to update the location of the potentially moving entity. In the interact method you even fire some async camera events ;o
Also, just throwing this out there, but..
public boolean isNpcValid(NPC npc) {
if (npc != null && npc.exists() && map.canReach(npc)) {
int id = npc.getId();
if (id != -1) {
for (NPC i : getNpcs().get(npc.getX(), npc.getY())) {
if (i.getId() == id)
return true;
}
}
}
return false;
}
For these, the whole "Is there an entity with this ID at these coordinates" is entirely redundant since you're using the Entity#exists check. Could be cleaned up a bit by removing it