java.lang.Object
org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.entity.ClientboundAddEntityPacket
All Implemented Interfaces:
Packet, MinecraftPacket

public class ClientboundAddEntityPacket extends Object implements MinecraftPacket
  • Constructor Details

    • ClientboundAddEntityPacket

      public ClientboundAddEntityPacket(int entityId, UUID uuid, EntityType type, double x, double y, double z, float yaw, float pitch, float headYaw)
    • ClientboundAddEntityPacket

      public ClientboundAddEntityPacket(int entityId, UUID uuid, EntityType type, ObjectData data, double x, double y, double z, float yaw, float pitch, float headYaw)
    • ClientboundAddEntityPacket

      public ClientboundAddEntityPacket(int entityId, UUID uuid, EntityType type, double x, double y, double z, org.cloudburstmc.math.vector.Vector3d movement, float yaw, float pitch, float headYaw)
    • ClientboundAddEntityPacket

      public ClientboundAddEntityPacket(io.netty.buffer.ByteBuf in)
    • ClientboundAddEntityPacket

      public ClientboundAddEntityPacket(int entityId, UUID uuid, EntityType type, ObjectData data, double x, double y, double z, org.cloudburstmc.math.vector.Vector3d movement, float yaw, float headYaw, float pitch)
  • Method Details

    • serialize

      public void serialize(io.netty.buffer.ByteBuf out)
      Specified by:
      serialize in interface MinecraftPacket
    • shouldRunOnGameThread

      public boolean shouldRunOnGameThread()
      Description copied from interface: Packet
      Gets whether the packet should run on an async game thread rather than blocking the network (Netty) thread. Packets that qualify for this are usually packets with an ensureRunningOnSameThread call at the top of their packet listener method in the Minecraft code. Packets which need extra attention because they aren't "fully" handled async are marked using // GAME THREAD DETAIL comments in the MCProtocolLib code.
      Specified by:
      shouldRunOnGameThread in interface Packet
      Returns:
      Whether the packet be handled async from the Netty thread.
    • getEntityId

      public int getEntityId()
    • getUuid

      public UUID getUuid()
    • getType

      public EntityType getType()
    • getData

      public ObjectData getData()
    • getX

      public double getX()
    • getY

      public double getY()
    • getZ

      public double getZ()
    • getMovement

      public org.cloudburstmc.math.vector.Vector3d getMovement()
    • getYaw

      public float getYaw()
    • getHeadYaw

      public float getHeadYaw()
    • getPitch

      public float getPitch()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • withEntityId

      public ClientboundAddEntityPacket withEntityId(int entityId)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withUuid

      public ClientboundAddEntityPacket withUuid(UUID uuid)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withType

      public ClientboundAddEntityPacket withType(EntityType type)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withData

      public ClientboundAddEntityPacket withData(ObjectData data)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withX

      public ClientboundAddEntityPacket withX(double x)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withY

      public ClientboundAddEntityPacket withY(double y)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withZ

      public ClientboundAddEntityPacket withZ(double z)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withMovement

      public ClientboundAddEntityPacket withMovement(org.cloudburstmc.math.vector.Vector3d movement)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withYaw

      public ClientboundAddEntityPacket withYaw(float yaw)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withHeadYaw

      public ClientboundAddEntityPacket withHeadYaw(float headYaw)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).
    • withPitch

      public ClientboundAddEntityPacket withPitch(float pitch)
      Returns:
      a clone of this object, except with this updated property (returns this if an identical value is passed).