use of com.bergerkiller.generated.net.minecraft.server.EntityTrackerEntryHandle in project BKCommonLib by bergerhealer.
the class EntityTrackerHook method updateTrackers.
private void updateTrackers(List<?> list) {
EntityHandle entityHandle = EntityHandle.createHandle(controller.getEntity().getHandle());
EntityTrackerEntryHandle handle = EntityTrackerEntryHandle.createHandle(instance());
if (handle.isSynched()) {
double lastSyncX = handle.getPrevX();
double lastSyncY = handle.getPrevY();
double lastSyncZ = handle.getPrevZ();
double distance = entityHandle.calculateDistance(lastSyncX, lastSyncY, lastSyncZ);
if (distance <= 16.0) {
return;
}
}
// Update tracking data
handle.setPrevX(entityHandle.getLocX());
handle.setPrevY(entityHandle.getLocY());
handle.setPrevZ(entityHandle.getLocZ());
handle.setSynched(true);
scanPlayers(list);
}
Aggregations