mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 04:02:01 +01:00
Trial fix for tablist flickering
This commit is contained in:
parent
4a73b0faf6
commit
61572db707
@ -24,6 +24,7 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker {
|
|||||||
|
|
||||||
public PlayerlistTracker(PlayerChunkMap map, Entity entity, int i, int j, boolean flag) {
|
public PlayerlistTracker(PlayerChunkMap map, Entity entity, int i, int j, boolean flag) {
|
||||||
map.super(entity, i, j, flag);
|
map.super(entity, i, j, flag);
|
||||||
|
System.out.println(entity + " " + i + " " + j + " " + flag);
|
||||||
this.map = map;
|
this.map = map;
|
||||||
this.tracker = getTracker(this);
|
this.tracker = getTracker(this);
|
||||||
this.trackerEntry = getTrackerEntry(this);
|
this.trackerEntry = getTrackerEntry(this);
|
||||||
@ -63,24 +64,23 @@ public class PlayerlistTracker extends PlayerChunkMap.EntityTracker {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updatePlayer(final EntityPlayer entityplayer) {
|
public void updatePlayer(final EntityPlayer entityplayer) {
|
||||||
// prevent updates to NPC "viewers"
|
|
||||||
if (entityplayer instanceof EntityHumanNPC)
|
if (entityplayer instanceof EntityHumanNPC)
|
||||||
return;
|
return; // prevent updates to NPC "viewers"
|
||||||
Entity tracker = getTracker(this);
|
Entity tracker = getTracker(this);
|
||||||
final Vec3D vec3d = new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ).d(this.trackerEntry.b());
|
final Vec3D vec3d = new Vec3D(entityplayer.locX, entityplayer.locY, entityplayer.locZ).d(this.trackerEntry.b());
|
||||||
final int i = Math.min(this.trackingDistance, (getA(map) - 1) * 16);
|
final int i = Math.min(this.trackingDistance, (getA(map) - 1) * 16);
|
||||||
final boolean flag = vec3d.x >= -i && vec3d.x <= i && vec3d.z >= -i && vec3d.z <= i
|
final boolean flag = vec3d.x >= -i && vec3d.x <= i && vec3d.z >= -i && vec3d.z <= i
|
||||||
&& this.tracker.a(entityplayer);
|
&& this.tracker.a(entityplayer);
|
||||||
if (entityplayer != tracker && flag && tracker instanceof SkinnableEntity) {
|
if (entityplayer != tracker && flag && tracker instanceof SkinnableEntity) {
|
||||||
boolean flag1 = this.tracker.attachedToPlayer;
|
/* boolean flag1 = this.tracker.attachedToPlayer;
|
||||||
if (!flag1) {
|
if (!flag1) {
|
||||||
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
|
||||||
PlayerChunk playerchunk = getVisibleChunk(chunkcoordintpair.pair());
|
PlayerChunk playerchunk = getVisibleChunk(chunkcoordintpair.pair());
|
||||||
if (playerchunk.getChunk() != null) {
|
if (playerchunk.getChunk() != null) {
|
||||||
flag1 = getb(chunkcoordintpair, entityplayer, false) <= getA(map);
|
flag1 = getb(chunkcoordintpair, entityplayer, false) <= getA(map);
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
if (flag1) {
|
if (!this.trackedPlayers.contains(entityplayer)) {
|
||||||
SkinnableEntity skinnable = (SkinnableEntity) tracker;
|
SkinnableEntity skinnable = (SkinnableEntity) tracker;
|
||||||
|
|
||||||
Player player = skinnable.getBukkitEntity();
|
Player player = skinnable.getBukkitEntity();
|
||||||
|
Loading…
Reference in New Issue
Block a user