ClientMovement class

Пакет: com.hypixel.hytale.protocol.packets.player

Файл: com/hypixel/hytale/protocol/packets/player/ClientMovement.java

implements: Packet, ToServerPacket

Поля (24)

МодификаторыТипИмя
final int PACKET_ID
ClientMovement var1
long var2
byte var2
byte var2
byte var2
byte var2
byte var2
byte var2
byte var2
byte var2
byte var2
ClientMovement var3
byte var3
var3
var3
var3
var3
var3
var3
var3
var3
var3
var3

Методы (50)

МодификаторыВозвратСигнатура
public ClientMovement cloneClientMovement clone()
abstract return getAbsolutePositionreturn getAbsolutePosition(var0, 0)
abstract return getBodyOrientationreturn getBodyOrientation(var0, 0)
abstract return getLookOrientationreturn getLookOrientation(var0, 0)
static int getMountedToint getMountedTo(MemorySegment var0)
static int getMountedToint getMountedTo(MemorySegment var0, int var1)
abstract return getMountedToreturn getMountedTo(var0, 0)
abstract return getMovementStatesreturn getMovementStates(var0, 0)
abstract return getRelativePositionreturn getRelativePosition(var0, 0)
abstract return getRiderMovementStatesreturn getRiderMovementStates(var0, 0)
abstract return getTeleportAckreturn getTeleportAck(var0, 0)
abstract return getVelocityreturn getVelocity(var0, 0)
abstract return getWishMovementreturn getWishMovement(var0, 0)
static boolean hasAbsolutePositionboolean hasAbsolutePosition(MemorySegment var0, int var1)
static boolean hasBodyOrientationboolean hasBodyOrientation(MemorySegment var0, int var1)
static boolean hasLookOrientationboolean hasLookOrientation(MemorySegment var0, int var1)
static boolean hasMovementStatesboolean hasMovementStates(MemorySegment var0, int var1)
static boolean hasRelativePositionboolean hasRelativePosition(MemorySegment var0, int var1)
static boolean hasRiderMovementStatesboolean hasRiderMovementStates(MemorySegment var0, int var1)
static boolean hasTeleportAckboolean hasTeleportAck(MemorySegment var0, int var1)
static boolean hasVelocityboolean hasVelocity(MemorySegment var0, int var1)
static boolean hasWishMovementboolean hasWishMovement(MemorySegment var0, int var1)
if if(var1 < 0)
if if(var2 != null)
if if(this.movementStates != null)
if if(this.relativePosition != null)
if if(this.absolutePosition != null)
if if(this.bodyOrientation != null)
if if(this.lookOrientation != null)
if if(this.teleportAck != null)
if if(this.wishMovement != null)
if if(this.velocity != null)
if if(this.riderMovementStates != null)
if if(this.movementStates != null)
if if(this.relativePosition != null)
if if(this.absolutePosition != null)
if if(this.bodyOrientation != null)
if if(this.lookOrientation != null)
if if(this.teleportAck != null)
if if(this.wishMovement != null)
if if(this.velocity != null)
if if(this.riderMovementStates != null)
if if(this == var1)
static void requireBoundsvoid requireBounds(MemorySegment var0, int var1)
abstract requireBounds requireBounds(var0, var1)
static ClientMovement toObjectClientMovement toObject(MemorySegment var0)
static ClientMovement toObjectClientMovement toObject(MemorySegment var0, int var1)
static ClientMovement toObjectClientMovement toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2)
abstract return toObjectreturn toObject(var0, 0, null)
abstract return toObjectreturn toObject(var0, var1, null)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.protocol.packets.player;

class="kw">import com.hypixel.hytale.protocol.Direction;
class="kw">import com.hypixel.hytale.protocol.HalfFloatPosition;
class="kw">import com.hypixel.hytale.protocol.MovementStates;
class="kw">import com.hypixel.hytale.protocol.NetworkChannel;
class="kw">import com.hypixel.hytale.protocol.Packet;
class="kw">import com.hypixel.hytale.protocol.Position;
class="kw">import com.hypixel.hytale.protocol.TeleportAck;
class="kw">import com.hypixel.hytale.protocol.ToServerPacket;
class="kw">import com.hypixel.hytale.protocol.Vector3d;
class="kw">import com.hypixel.hytale.protocol.io.PacketIO;
class="kw">import com.hypixel.hytale.protocol.io.ProtocolException;
class="kw">import com.hypixel.hytale.protocol.io.ReadCursor;
class="kw">import java.lang.foreign.MemorySegment;
class="kw">import java.util.Objects;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class ClientMovement class="kw">implements Packet, ToServerPacket {
   class="kw">public class="kw">static class="kw">final int PACKET_ID = 108;
   class="kw">public class="kw">static class="kw">final boolean IS_COMPRESSED = false;
   class="kw">public class="kw">static class="kw">final int NULLABLE_BIT_FIELD_SIZE = 2;
   class="kw">public class="kw">static class="kw">final int FIXED_BLOCK_SIZE = 117;
   class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 0;
   class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 117;
   class="kw">public class="kw">static class="kw">final int MAX_SIZE = 117;
   @Nullable
   class="kw">public MovementStates movementStates;
   @Nullable
   class="kw">public HalfFloatPosition relativePosition;
   @Nullable
   class="kw">public Position absolutePosition;
   @Nullable
   class="kw">public Direction bodyOrientation;
   @Nullable
   class="kw">public Direction lookOrientation;
   @Nullable
   class="kw">public TeleportAck teleportAck;
   @Nullable
   class="kw">public Position wishMovement;
   @Nullable
   class="kw">public Vector3d velocity;
   class="kw">public int mountedTo;
   @Nullable
   class="kw">public MovementStates riderMovementStates;

   @Override
   class="kw">public int getId() {
      class="kw">return 108;
   }

   @Override
   class="kw">public NetworkChannel getChannel() {
      class="kw">return NetworkChannel.Default;
   }

   class="kw">public ClientMovement() {
   }

   class="kw">public ClientMovement(
      @Nullable MovementStates var1,
      @Nullable HalfFloatPosition var2,
      @Nullable Position var3,
      @Nullable Direction var4,
      @Nullable Direction var5,
      @Nullable TeleportAck var6,
      @Nullable Position var7,
      @Nullable Vector3d var8,
      int var9,
      @Nullable MovementStates var10
   ) {
      this.movementStates = var1;
      this.relativePosition = var2;
      this.absolutePosition = var3;
      this.bodyOrientation = var4;
      this.lookOrientation = var5;
      this.teleportAck = var6;
      this.wishMovement = var7;
      this.velocity = var8;
      this.mountedTo = var9;
      this.riderMovementStates = var10;
   }

   class="kw">public ClientMovement(@Nonnull ClientMovement var1) {
      this.movementStates = var1.movementStates;
      this.relativePosition = var1.relativePosition;
      this.absolutePosition = var1.absolutePosition;
      this.bodyOrientation = var1.bodyOrientation;
      this.lookOrientation = var1.lookOrientation;
      this.teleportAck = var1.teleportAck;
      this.wishMovement = var1.wishMovement;
      this.velocity = var1.velocity;
      this.mountedTo = var1.mountedTo;
      this.riderMovementStates = var1.riderMovementStates;
   }

   class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
      if (var1 < 0) {
         throw ProtocolException.invalidOffset("ClientMovement", var1, (int)var0.byteSize());
      }

      long var2 = var1 + 117L;
      if (var2 > var0.byteSize()) {
         throw ProtocolException.bufferTooSmall("ClientMovement", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
      }
   }

   @Nullable
   class="kw">public class="kw">static MovementStates getMovementStates(MemorySegment var0) {
      class="kw">return getMovementStates(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static MovementStates getMovementStates(MemorySegment var0, int var1) {
      class="kw">return hasMovementStates(var0, var1) ? MovementStates.toObject(var0, var1 + 2) : null;
   }

   @Nullable
   class="kw">public class="kw">static HalfFloatPosition getRelativePosition(MemorySegment var0) {
      class="kw">return getRelativePosition(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static HalfFloatPosition getRelativePosition(MemorySegment var0, int var1) {
      class="kw">return hasRelativePosition(var0, var1) ? HalfFloatPosition.toObject(var0, var1 + 6) : null;
   }

   @Nullable
   class="kw">public class="kw">static Position getAbsolutePosition(MemorySegment var0) {
      class="kw">return getAbsolutePosition(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static Position getAbsolutePosition(MemorySegment var0, int var1) {
      class="kw">return hasAbsolutePosition(var0, var1) ? Position.toObject(var0, var1 + 12) : null;
   }

   @Nullable
   class="kw">public class="kw">static Direction getBodyOrientation(MemorySegment var0) {
      class="kw">return getBodyOrientation(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static Direction getBodyOrientation(MemorySegment var0, int var1) {
      class="kw">return hasBodyOrientation(var0, var1) ? Direction.toObject(var0, var1 + 36) : null;
   }

   @Nullable
   class="kw">public class="kw">static Direction getLookOrientation(MemorySegment var0) {
      class="kw">return getLookOrientation(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static Direction getLookOrientation(MemorySegment var0, int var1) {
      class="kw">return hasLookOrientation(var0, var1) ? Direction.toObject(var0, var1 + 48) : null;
   }

   @Nullable
   class="kw">public class="kw">static TeleportAck getTeleportAck(MemorySegment var0) {
      class="kw">return getTeleportAck(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static TeleportAck getTeleportAck(MemorySegment var0, int var1) {
      class="kw">return hasTeleportAck(var0, var1) ? TeleportAck.toObject(var0, var1 + 60) : null;
   }

   @Nullable
   class="kw">public class="kw">static Position getWishMovement(MemorySegment var0) {
      class="kw">return getWishMovement(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static Position getWishMovement(MemorySegment var0, int var1) {
      class="kw">return hasWishMovement(var0, var1) ? Position.toObject(var0, var1 + 61) : null;
   }

   @Nullable
   class="kw">public class="kw">static Vector3d getVelocity(MemorySegment var0) {
      class="kw">return getVelocity(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static Vector3d getVelocity(MemorySegment var0, int var1) {
      class="kw">return hasVelocity(var0, var1) ? Vector3d.toObject(var0, var1 + 85) : null;
   }

   class="kw">public class="kw">static int getMountedTo(MemorySegment var0) {
      class="kw">return getMountedTo(var0, 0);
   }

   class="kw">public class="kw">static int getMountedTo(MemorySegment var0, int var1) {
      class="kw">return var0.get(PacketIO.PROTO_INT, var1 + 109);
   }

   @Nullable
   class="kw">public class="kw">static MovementStates getRiderMovementStates(MemorySegment var0) {
      class="kw">return getRiderMovementStates(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static MovementStates getRiderMovementStates(MemorySegment var0, int var1) {
      class="kw">return hasRiderMovementStates(var0, var1) ? MovementStates.toObject(var0, var1 + 113) : null;
   }

   class="kw">public class="kw">static boolean hasMovementStates(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 1) != 0;
   }

   class="kw">public class="kw">static boolean hasRelativePosition(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 2) != 0;
   }

   class="kw">public class="kw">static boolean hasAbsolutePosition(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 4) != 0;
   }

   class="kw">public class="kw">static boolean hasBodyOrientation(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 8) != 0;
   }

   class="kw">public class="kw">static boolean hasLookOrientation(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 16) != 0;
   }

   class="kw">public class="kw">static boolean hasTeleportAck(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 32) != 0;
   }

   class="kw">public class="kw">static boolean hasWishMovement(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 64) != 0;
   }

   class="kw">public class="kw">static boolean hasVelocity(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 128) != 0;
   }

   class="kw">public class="kw">static boolean hasRiderMovementStates(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 1);
      class="kw">return (var2 & 1) != 0;
   }

   class="kw">public class="kw">static ClientMovement toObject(MemorySegment var0) {
      class="kw">return toObject(var0, 0, null);
   }

   class="kw">public class="kw">static ClientMovement toObject(MemorySegment var0, int var1) {
      class="kw">return toObject(var0, var1, null);
   }

   class="kw">public class="kw">static ClientMovement toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
      requireBounds(var0, var1);
      ClientMovement var3 = new ClientMovement(
         hasMovementStates(var0, var1) ? MovementStates.toObject(var0, var1 + 2) : null,
         hasRelativePosition(var0, var1) ? HalfFloatPosition.toObject(var0, var1 + 6) : null,
         hasAbsolutePosition(var0, var1) ? Position.toObject(var0, var1 + 12) : null,
         hasBodyOrientation(var0, var1) ? Direction.toObject(var0, var1 + 36) : null,
         hasLookOrientation(var0, var1) ? Direction.toObject(var0, var1 + 48) : null,
         hasTeleportAck(var0, var1) ? TeleportAck.toObject(var0, var1 + 60) : null,
         hasWishMovement(var0, var1) ? Position.toObject(var0, var1 + 61) : null,
         hasVelocity(var0, var1) ? Vector3d.toObject(var0, var1 + 85) : null,
         var0.get(PacketIO.PROTO_INT, var1 + 109),
         hasRiderMovementStates(var0, var1) ? MovementStates.toObject(var0, var1 + 113) : null
      );
      if (var2 != null) {
         var2.position = var1 + 117;
      }

      class="kw">return var3;
   }

   @Override
   class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
      byte var3 = 0;
      if (this.movementStates != null) {
         var3 = (byte)(var3 | 1);
      }

      if (this.relativePosition != null) {
         var3 = (byte)(var3 | 2);
      }

      if (this.absolutePosition != null) {
         var3 = (byte)(var3 | 4);
      }

      if (this.bodyOrientation != null) {
         var3 = (byte)(var3 | 8);
      }

      if (this.lookOrientation != null) {
         var3 = (byte)(var3 | 16);
      }

      if (this.teleportAck != null) {
         var3 = (byte)(var3 | 32);
      }

      if (this.wishMovement != null) {
         var3 = (byte)(var3 | 64);
      }

      if (this.velocity != null) {
         var3 = (byte)(var3 | 128);
      }

      var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
      var3 = 0;
      if (this.riderMovementStates != null) {
         var3 = (byte)(var3 | 1);
      }

      var1.set(PacketIO.PROTO_BYTE, var2 + 1, var3);
      if (this.movementStates != null) {
         this.movementStates.serialize(var1, var2 + 2);
      } else {
         var1.asSlice(var2 + 2, 4L).fill((byte)0);
      }

      if (this.relativePosition != null) {
         this.relativePosition.serialize(var1, var2 + 6);
      } else {
         var1.asSlice(var2 + 6, 6L).fill((byte)0);
      }

      if (this.absolutePosition != null) {
         this.absolutePosition.serialize(var1, var2 + 12);
      } else {
         var1.asSlice(var2 + 12, 24L).fill((byte)0);
      }

      if (this.bodyOrientation != null) {
         this.bodyOrientation.serialize(var1, var2 + 36);
      } else {
         var1.asSlice(var2 + 36, 12L).fill((byte)0);
      }

      if (this.lookOrientation != null) {
         this.lookOrientation.serialize(var1, var2 + 48);
      } else {
         var1.asSlice(var2 + 48, 12L).fill((byte)0);
      }

      if (this.teleportAck != null) {
         this.teleportAck.serialize(var1, var2 + 60);
      } else {
         var1.asSlice(var2 + 60, 1L).fill((byte)0);
      }

      if (this.wishMovement != null) {
         this.wishMovement.serialize(var1, var2 + 61);
      } else {
         var1.asSlice(var2 + 61, 24L).fill((byte)0);
      }

      if (this.velocity != null) {
         this.velocity.serialize(var1, var2 + 85);
      } else {
         var1.asSlice(var2 + 85, 24L).fill((byte)0);
      }

      var1.set(PacketIO.PROTO_INT, var2 + 109, this.mountedTo);
      if (this.riderMovementStates != null) {
         this.riderMovementStates.serialize(var1, var2 + 113);
      } else {
         var1.asSlice(var2 + 113, 4L).fill((byte)0);
      }

      class="kw">return 117;
   }

   @Override
   class="kw">public int computeSize() {
      class="kw">return 117;
   }

   class="kw">public ClientMovement clone() {
      ClientMovement var1 = new ClientMovement();
      var1.movementStates = this.movementStates != null ? this.movementStates.clone() : null;
      var1.relativePosition = this.relativePosition != null ? this.relativePosition.clone() : null;
      var1.absolutePosition = this.absolutePosition != null ? this.absolutePosition.clone() : null;
      var1.bodyOrientation = this.bodyOrientation != null ? this.bodyOrientation.clone() : null;
      var1.lookOrientation = this.lookOrientation != null ? this.lookOrientation.clone() : null;
      var1.teleportAck = this.teleportAck != null ? this.teleportAck.clone() : null;
      var1.wishMovement = this.wishMovement != null ? this.wishMovement.clone() : null;
      var1.velocity = this.velocity != null ? this.velocity.clone() : null;
      var1.mountedTo = this.mountedTo;
      var1.riderMovementStates = this.riderMovementStates != null ? this.riderMovementStates.clone() : null;
      class="kw">return var1;
   }

   @Override
   class="kw">public boolean equals(Object var1) {
      if (this == var1) {
         class="kw">return true;
      } else {
         class="kw">return !(var1 class="kw">instanceof ClientMovement var2)
            ? false
            : Objects.equals(this.movementStates, var2.movementStates)
               && Objects.equals(this.relativePosition, var2.relativePosition)
               && Objects.equals(this.absolutePosition, var2.absolutePosition)
               && Objects.equals(this.bodyOrientation, var2.bodyOrientation)
               && Objects.equals(this.lookOrientation, var2.lookOrientation)
               && Objects.equals(this.teleportAck, var2.teleportAck)
               && Objects.equals(this.wishMovement, var2.wishMovement)
               && Objects.equals(this.velocity, var2.velocity)
               && this.mountedTo == var2.mountedTo
               && Objects.equals(this.riderMovementStates, var2.riderMovementStates);
      }
   }

   @Override
   class="kw">public int hashCode() {
      class="kw">return Objects.hash(
         this.movementStates,
         this.relativePosition,
         this.absolutePosition,
         this.bodyOrientation,
         this.lookOrientation,
         this.teleportAck,
         this.wishMovement,
         this.velocity,
         this.mountedTo,
         this.riderMovementStates
      );
   }
}