Attempted fix for /npc tphere - make NPCs tracked over a longer range than previously

This commit is contained in:
fullwall 2020-05-12 19:43:52 +08:00
parent c2467b7a25
commit a044eed988
2 changed files with 4 additions and 3 deletions

View File

@ -67,7 +67,7 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker {
return; // prevent updates to NPC "viewers"
Entity tracker = getTracker(this);
final Vec3D vec3d = new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ).d(this.trackerEntry.b());
final int i = Math.min(this.trackingDistance, (getViewDistance(map) - 1) * 16);
final int i = Math.max(this.trackingDistance, (getViewDistance(map) - 1) * 16);
final boolean flag = vec3d.x >= -i && vec3d.x <= i && vec3d.z >= -i && vec3d.z <= i
&& this.tracker.a(entityplayer);
if (entityplayer != tracker && flag && tracker instanceof SkinnableEntity) {

View File

@ -68,7 +68,7 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker {
Entity tracker = getTracker(this);
final Vec3D vec3d = new Vec3D(entityplayer.locX(), entityplayer.locY(), entityplayer.locZ())
.d(this.trackerEntry.b());
final int i = Math.min(this.trackingDistance, (getViewDistance(map) - 1) * 16);
final int i = Math.max(this.trackingDistance, (getViewDistance(map) - 1) * 16);
final boolean flag = vec3d.x >= -i && vec3d.x <= i && vec3d.z >= -i && vec3d.z <= i
&& this.tracker.a(entityplayer);
if (entityplayer != tracker && flag && tracker instanceof SkinnableEntity) {
@ -80,7 +80,8 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker {
flag1 = getb(chunkcoordintpair, entityplayer, false) <= getViewDistance(map);
}
}*/
if (!this.trackedPlayers.contains(entityplayer)) {
if (!this.trackedPlayers.contains(entityplayer) || true) {
SkinnableEntity skinnable = (SkinnableEntity) tracker;
Player player = skinnable.getBukkitEntity();