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 booleanalwaysUpdateVelocityprivate Entityentityprivate booleanhadVehicleprivate intlastHeadPitchprivate booleanlastOnGroundprivate List<Entity>lastPassengersprivate intlastPitchprivate longlastXprivate longlastYprivate intlastYawprivate longlastZprivate static LoggerLOGGERprivate Consumer<Packet<?>>receiverprivate inttickIntervalprivate inttrackingTickprivate intupdatesWithoutVehicleprivate Vec3dvelocityprivate ServerWorldworld -
Constructor Summary
Constructors Constructor Description EntityTrackerEntry(ServerWorld world, Entity entity, int tickInterval, boolean alwaysUpdateVelocity, Consumer<Packet<?>> receiver) -
Method Summary
Modifier and Type Method Description Vec3dgetLastPos()Decodes lastX/Y/Z into a position vectorvoidsendPackets(Consumer<Packet<?>> sender)private voidsendSyncPacket(Packet<?> packet)Sends a packet for synchronization with watcher and tracked player (if applicable)voidstartTracking(ServerPlayerEntity player)voidstopTracking(ServerPlayerEntity player)private voidstoreEncodedCoordinates()Stores the tracked entity's current coordinates encoded as lastX/Y/Zprivate voidsyncEntityData()Synchronizes tracked data and attributesvoidtick()
-
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)
-