AudioUpdate class

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

Файл: com/hypixel/hytale/protocol/AudioUpdate.java

extends: ComponentUpdate

Поля (20)

МодификаторыТипИмя
final int NULLABLE_BIT_FIELD_SIZE
int var1
AudioUpdate var1
int var1
int var10
AudioUpdate var13
long var2
int var2
long var3
int var3
int var3
int var4
var4
int var5
int[] var5
int var6
int var6
int[] var7
long var7
int var9

Методы (19)

МодификаторыВозвратСигнатура
public AudioUpdate cloneAudioUpdate clone()
static int[] getSoundEventIdsint[] getSoundEventIds(MemorySegment var0)
static int[] getSoundEventIdsint[] getSoundEventIds(MemorySegment var0, int var1)
abstract return getSoundEventIdsreturn getSoundEventIds(var0, 0)
if if(var1 < 0)
if if(var3 == -1L)
if if(var5 > 4096000)
if if(var7 == -1L)
if if(var9 > 4096000)
if if(var2 != null)
if if(this.soundEventIds.length > 4096000)
if if(this == var1)
static void requireBoundsvoid requireBounds(MemorySegment var0, int var1)
abstract requireBounds requireBounds(var0, var1)
static AudioUpdate toObjectAudioUpdate toObject(MemorySegment var0)
static AudioUpdate toObjectAudioUpdate toObject(MemorySegment var0, int var1)
static AudioUpdate toObjectAudioUpdate 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;

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 com.hypixel.hytale.protocol.io.VarInt;
class="kw">import java.lang.foreign.MemorySegment;
class="kw">import java.util.Arrays;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class AudioUpdate class="kw">extends ComponentUpdate {
   class="kw">public class="kw">static class="kw">final int NULLABLE_BIT_FIELD_SIZE = 0;
   class="kw">public class="kw">static class="kw">final int FIXED_BLOCK_SIZE = 0;
   class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 1;
   class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 0;
   class="kw">public class="kw">static class="kw">final int MAX_SIZE = 16384005;
   @Nonnull
   class="kw">public int[] soundEventIds = new int[0];

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

   class="kw">public AudioUpdate(@Nonnull int[] var1) {
      this.soundEventIds = var1;
   }

   class="kw">public AudioUpdate(@Nonnull AudioUpdate var1) {
      this.soundEventIds = var1.soundEventIds;
   }

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

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

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

   class="kw">public class="kw">static int[] getSoundEventIds(MemorySegment var0, int var1) {
      int var2 = var1 + 0;
      long var3 = VarInt.getWithLength(var0, var2);
      if (var3 == -1L) {
         throw ProtocolException.invalidVarInt("SoundEventIds");
      }

      int var5 = (int)var3;
      if (var5 > 4096000) {
         throw ProtocolException.arrayTooLong("SoundEventIds", var5, 4096000);
      }

      int var6 = (int)(var3 >>> 32);
      if (var2 + var6 + var5 * 4L > var0.byteSize()) {
         throw ProtocolException.bufferTooSmall("SoundEventIds", (int)Math.min(var2 + var6 + var5 * 4L, 2147483647L), (int)var0.byteSize());
      }

      var2 += var6;
      int[] var7 = new int[var5];
      MemorySegment.copy(var0, PacketIO.PROTO_INT, var2, var7, 0, var5);
      class="kw">return var7;
   }

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

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

   class="kw">public class="kw">static AudioUpdate toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
      requireBounds(var0, var1);
      int var3 = var1 + 0;
      int var4 = 0;
      int var6 = var3 + var4;
      long var7 = VarInt.getWithLength(var0, var6);
      if (var7 == -1L) {
         throw ProtocolException.invalidVarInt("SoundEventIds");
      }

      int var9 = (int)var7;
      if (var9 > 4096000) {
         throw ProtocolException.arrayTooLong("SoundEventIds", var9, 4096000);
      }

      int var10 = (int)(var7 >>> 32);
      if (var6 + var10 + var9 * 4L > var0.byteSize()) {
         throw ProtocolException.bufferTooSmall("SoundEventIds", (int)Math.min(var6 + var10 + var9 * 4L, 2147483647L), (int)var0.byteSize());
      }

      var6 += var10;
      int[] var5 = new int[var9];
      MemorySegment.copy(var0, PacketIO.PROTO_INT, var6, var5, 0, var9);
      var4 = var6 + var9 * 4 - var3;
      AudioUpdate var13 = new AudioUpdate(var5);
      if (var2 != null) {
         var2.position = var3 + var4;
      }

      class="kw">return var13;
   }

   @Override
   class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
      int var3 = var2 + 0;
      if (this.soundEventIds.length > 4096000) {
         throw ProtocolException.arrayTooLong("SoundEventIds", this.soundEventIds.length, 4096000);
      }

      var3 += VarInt.set(var1, var3, this.soundEventIds.length);
      MemorySegment.copy(this.soundEventIds, 0, var1, PacketIO.PROTO_INT, var3, this.soundEventIds.length);
      var3 += this.soundEventIds.length * 4;
      class="kw">return var3 - var2;
   }

   @Override
   class="kw">public int computeSize() {
      int var1 = 0;
      class="kw">return var1 + VarInt.size(this.soundEventIds.length) + this.soundEventIds.length * 4;
   }

   class="kw">public AudioUpdate clone() {
      AudioUpdate var1 = new AudioUpdate();
      var1.soundEventIds = Arrays.copyOf(this.soundEventIds, this.soundEventIds.length);
      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 AudioUpdate var2 ? Arrays.equals(this.soundEventIds, var2.soundEventIds) : false;
      }
   }

   @Override
   class="kw">public int hashCode() {
      int var1 = 1;
      class="kw">return 31 * var1 + Arrays.hashCode(this.soundEventIds);
   }
}