Class EntityTrackerEntry

java.lang.Object
net.minecraft.server.network.EntityTrackerEntry

public class EntityTrackerEntry
extends Object
  • Field Details

    • LOGGER

      private static final Logger LOGGER
    • world

      private final ServerWorld world
    • entity

      private final Entity entity
    • tickInterval

      private final int tickInterval
    • alwaysUpdateVelocity

      private final boolean alwaysUpdateVelocity
    • receiver

      private final Consumer<Packet<?>> 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

      private Vec3d velocity
    • trackingTick

      private int trackingTick
    • updatesWithoutVehicle

      private int updatesWithoutVehicle
    • lastPassengers

      private List<Entity> 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

      public void stopTracking​(ServerPlayerEntity player)
    • startTracking

      public void startTracking​(ServerPlayerEntity player)
    • sendPackets

      public void sendPackets​(Consumer<Packet<?>> sender)
    • 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

      public Vec3d getLastPos()
      Decodes lastX/Y/Z into a position vector
    • sendSyncPacket

      private void sendSyncPacket​(Packet<?> packet)
      Sends a packet for synchronization with watcher and tracked player (if applicable)