npc.getInteractingEntity now almost fully works, it returns the correct Actor in all but one cases: when the Actor is the local player.
As demonstrated in
this image: The yaks attacking other players do interact with those players, but the one yak attacking the local player has drawn "null" on its model, to indicate getInteractingEntity returned null for said yak.
This must be fixed asap, for it would be incredibly difficult to detect random events without this!
Code:
for (final Npc npc : Npcs.getLoaded()) {
final Model m = npc.getModel();
final Actor a = npc.getInteractingEntity();
if (m == null) {
continue;
}
final InteractableRectangle ir = m.getBoundingRectangle();
if (ir == null) {
continue;
}
final Rectangle r = ir.getBounds();
g.drawString(a != null ? a.getName() : "null", r.x + (r.width / 2), r.y + (r.height / 2));
}
Also, when I started Beta 6 for the first time my stored account information had corrupted and showed only partially. I guess that that is the result of changing a few things around, but in case it actually is a bug, I thought I'd post it.