Package net.minecraft.server.network
Class EntityTrackerEntry
java.lang.Object
net.minecraft.server.network.EntityTrackerEntry
public class EntityTrackerEntry extends Object
-
Field Summary
Fields Modifier and Type Field Description private boolean
alwaysUpdateVelocity
private Entity
entity
private boolean
hadVehicle
private int
lastHeadPitch
private boolean
lastOnGround
private List<Entity>
lastPassengers
private int
lastPitch
private long
lastX
private long
lastY
private int
lastYaw
private long
lastZ
private static Logger
LOGGER
private Consumer<Packet<?>>
receiver
private int
tickInterval
private int
trackingTick
private int
updatesWithoutVehicle
private Vec3d
velocity
private ServerWorld
world
-
Constructor Summary
Constructors Constructor Description EntityTrackerEntry(ServerWorld world, Entity entity, int tickInterval, boolean alwaysUpdateVelocity, Consumer<Packet<?>> receiver)
-
Method Summary
Modifier and Type Method Description Vec3d
getLastPos()
Decodes lastX/Y/Z into a position vectorvoid
sendPackets(Consumer<Packet<?>> sender)
private void
sendSyncPacket(Packet<?> packet)
Sends a packet for synchronization with watcher and tracked player (if applicable)void
startTracking(ServerPlayerEntity player)
void
stopTracking(ServerPlayerEntity player)
private void
storeEncodedCoordinates()
Stores the tracked entity's current coordinates encoded as lastX/Y/Zprivate void
syncEntityData()
Synchronizes tracked data and attributesvoid
tick()
-
Field Details
-
LOGGER
-
world
-
entity
-
tickInterval
private final int tickInterval -
alwaysUpdateVelocity
private final boolean alwaysUpdateVelocity -
receiver
-
lastX
private long lastX -
lastY
private long lastY -
lastZ
private long lastZ -
lastYaw
private int lastYaw -
lastPitch
private int lastPitch -
lastHeadPitch
private int lastHeadPitch -
velocity
-
trackingTick
private int trackingTick -
updatesWithoutVehicle
private int updatesWithoutVehicle -
lastPassengers
-
hadVehicle
private boolean hadVehicle -
lastOnGround
private boolean lastOnGround
-
-
Constructor Details
-
EntityTrackerEntry
public EntityTrackerEntry(ServerWorld world, Entity entity, int tickInterval, boolean alwaysUpdateVelocity, Consumer<Packet<?>> receiver)
-
-
Method Details
-
tick
public void tick() -
stopTracking
-
startTracking
-
sendPackets
-
syncEntityData
private void syncEntityData()Synchronizes tracked data and attributes -
storeEncodedCoordinates
private void storeEncodedCoordinates()Stores the tracked entity's current coordinates encoded as lastX/Y/Z -
getLastPos
Decodes lastX/Y/Z into a position vector -
sendSyncPacket
Sends a packet for synchronization with watcher and tracked player (if applicable)
-