public class EntityTrackerEntry extends Object
Modifier and Type | Field and 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 and Description |
---|
EntityTrackerEntry(ServerWorld world,
Entity entity,
int tickInterval,
boolean alwaysUpdateVelocity,
Consumer<Packet<?>> receiver) |
Modifier and Type | Method and Description |
---|---|
Vec3d |
getLastPos()
Decodes lastX/Y/Z into a position vector
|
void |
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/Z
|
private void |
syncEntityData()
Synchronizes tracked data and attributes
|
void |
tick() |
private static final Logger LOGGER
private final ServerWorld world
private final Entity entity
private final int tickInterval
private final boolean alwaysUpdateVelocity
private long lastX
private long lastY
private long lastZ
private int lastYaw
private int lastPitch
private int lastHeadPitch
private Vec3d velocity
private int trackingTick
private int updatesWithoutVehicle
private boolean hadVehicle
private boolean lastOnGround
public EntityTrackerEntry(ServerWorld world, Entity entity, int tickInterval, boolean alwaysUpdateVelocity, Consumer<Packet<?>> receiver)
public void tick()
public void stopTracking(ServerPlayerEntity player)
public void startTracking(ServerPlayerEntity player)
private void syncEntityData()
private void storeEncodedCoordinates()
public Vec3d getLastPos()
private void sendSyncPacket(Packet<?> packet)