Removed isNettyClient field

This commit is contained in:
Németh Noel 2021-05-01 04:38:04 +02:00
parent 3abef8c9a7
commit 78dc2b32cd
2 changed files with 2 additions and 4 deletions

View File

@ -138,8 +138,6 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
*/
private final Object entityTypeLock = new Object();
protected boolean isNettyClient;
public Entity(@NotNull EntityType entityType, @NotNull UUID uuid) {
this.id = generateId();
this.entityType = entityType;
@ -496,6 +494,7 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
}
sendPositionUpdate(true);
final boolean isNettyClient = PlayerUtils.isNettyClient(this);
// Entity tick
{
@ -742,7 +741,7 @@ public class Entity implements Viewable, Tickable, EventHandler, DataContainer,
return;
}
if (isNettyClient && notFromListener) {
if (PlayerUtils.isNettyClient(this) && notFromListener) {
final PlayerPositionAndLookPacket playerPositionAndLookPacket = new PlayerPositionAndLookPacket();
playerPositionAndLookPacket.flags = 0b111;
playerPositionAndLookPacket.position = position.clone().subtract(lastSyncedPosition.getX(), lastSyncedPosition.getY(), lastSyncedPosition.getZ());

View File

@ -181,7 +181,6 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
super(EntityType.PLAYER, uuid);
this.username = username;
this.playerConnection = playerConnection;
this.isNettyClient = PlayerUtils.isNettyClient(this);
setBoundingBox(0.6f, 1.8f, 0.6f);