Class EntityS2CPacket
java.lang.Object
net.minecraft.network.packet.s2c.play.EntityS2CPacket
- All Implemented Interfaces:
Packet<ClientPlayPacketListener>
- Direct Known Subclasses:
EntityS2CPacket.MoveRelative,EntityS2CPacket.Rotate,EntityS2CPacket.RotateAndMoveRelative
public class EntityS2CPacket extends Object implements Packet<ClientPlayPacketListener>
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntityS2CPacket.MoveRelativestatic classEntityS2CPacket.Rotatestatic classEntityS2CPacket.RotateAndMoveRelative -
Field Summary
-
Constructor Summary
Constructors Constructor Description EntityS2CPacket()EntityS2CPacket(int entityId) -
Method Summary
Modifier and Type Method Description voidapply(ClientPlayPacketListener clientPlayPacketListener)Vec3dcalculateDeltaPosition(Vec3d orig)static doubledecodePacketCoordinate(long coord)static Vec3ddecodePacketCoordinates(long x, long y, long z)static longencodePacketCoordinate(double coord)EntitygetEntity(World world)bytegetPitch()bytegetYaw()booleanhasRotation()booleanisOnGround()booleanisPositionChanged()voidread(PacketByteBuf buf)StringtoString()voidwrite(PacketByteBuf buf)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.Packet
isWritingErrorSkippable
-
Field Details
-
id
protected int id -
deltaX
protected short deltaX -
deltaY
protected short deltaY -
deltaZ
protected short deltaZ -
yaw
protected byte yaw -
pitch
protected byte pitch -
onGround
protected boolean onGround -
rotate
protected boolean rotate -
positionChanged
protected boolean positionChanged
-
-
Constructor Details
-
EntityS2CPacket
public EntityS2CPacket() -
EntityS2CPacket
public EntityS2CPacket(int entityId)
-
-
Method Details
-
encodePacketCoordinate
public static long encodePacketCoordinate(double coord) -
decodePacketCoordinate
@Environment(CLIENT) public static double decodePacketCoordinate(long coord) -
calculateDeltaPosition
-
decodePacketCoordinates
-
read
- Specified by:
readin interfacePacket<ClientPlayPacketListener>- Throws:
IOException
-
write
- Specified by:
writein interfacePacket<ClientPlayPacketListener>- Throws:
IOException
-
apply
- Specified by:
applyin interfacePacket<ClientPlayPacketListener>
-
toString
-
getEntity
-
getYaw
@Environment(CLIENT) public byte getYaw() -
getPitch
@Environment(CLIENT) public byte getPitch() -
hasRotation
@Environment(CLIENT) public boolean hasRotation() -
isPositionChanged
@Environment(CLIENT) public boolean isPositionChanged() -
isOnGround
@Environment(CLIENT) public boolean isOnGround()
-