Class ServerboundMovePlayerPacket

java.lang.Object
net.minecraft.network.protocol.game.ServerboundMovePlayerPacket
All Implemented Interfaces:
Packet<ServerGamePacketListener>
Direct Known Subclasses:
ServerboundMovePlayerPacket.Pos, ServerboundMovePlayerPacket.PosRot, ServerboundMovePlayerPacket.Rot, ServerboundMovePlayerPacket.StatusOnly

public abstract class ServerboundMovePlayerPacket extends Object implements Packet<ServerGamePacketListener>
  • Field Details

    • FLAG_ON_GROUND

      private static final int FLAG_ON_GROUND
      See Also:
    • FLAG_HORIZONTAL_COLLISION

      private static final int FLAG_HORIZONTAL_COLLISION
      See Also:
    • x

      protected final double x
    • y

      protected final double y
    • z

      protected final double z
    • yRot

      protected final float yRot
    • xRot

      protected final float xRot
    • onGround

      protected final boolean onGround
    • horizontalCollision

      protected final boolean horizontalCollision
    • hasPos

      protected final boolean hasPos
    • hasRot

      protected final boolean hasRot
  • Constructor Details

    • ServerboundMovePlayerPacket

      protected ServerboundMovePlayerPacket(double x, double y, double z, float yRot, float xRot, boolean onGround, boolean horizontalCollision, boolean hasPos, boolean hasRot)
  • Method Details

    • packFlags

      private static int packFlags(boolean onGround, boolean horizontalCollision)
    • unpackOnGround

      private static boolean unpackOnGround(int flags)
    • unpackHorizontalCollision

      private static boolean unpackHorizontalCollision(int flags)
    • type

      public abstract PacketType<? extends ServerboundMovePlayerPacket> type()
      Specified by:
      type in interface Packet<ServerGamePacketListener>
    • handle

      public void handle(ServerGamePacketListener listener)
      Passes this Packet on to the NetHandler for processing.
      Specified by:
      handle in interface Packet<ServerGamePacketListener>
    • getX

      public double getX(double fallback)
    • getY

      public double getY(double fallback)
    • getZ

      public double getZ(double fallback)
    • getYRot

      public float getYRot(float fallback)
    • getXRot

      public float getXRot(float fallback)
    • isOnGround

      public boolean isOnGround()
    • horizontalCollision

      public boolean horizontalCollision()
    • hasPosition

      public boolean hasPosition()
    • hasRotation

      public boolean hasRotation()