AssetEditorRequestChildrenListReply class

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

Файл: com/hypixel/hytale/protocol/packets/asseteditor/AssetEditorRequestChildrenListReply.java

implements: Packet, ToClientPacket

Поля (37)

МодификаторыТипИмя
final int PACKET_ID
int var1
AssetEditorRequestChildrenListReply var1
int var1
var1
int var11
int var12
long var14
AssetEditorRequestChildrenListReply var17
long var2
int var2
byte var2
byte var2
int var2
long var3
int var3
byte var3
var3
var3
int var4
int var4
var4
var4
int var4
int var5
int var5
ReadCursor var5
int var5
int var6
AssetPath var6
var6
String[] var7
String[] var7
var7
int var8
long var9
long var9

Методы (37)

МодификаторыВозвратСигнатура
public AssetEditorRequestChildrenListReply cloneAssetEditorRequestChildrenListReply clone()
for for(int var8 = 0; var8 < var5; var8++)
for for(int var13 = 0; var13 < var11; var13++)
for for(int var6 = 0; var6 < this.childrenIds.length; var6++)
for for(String var6 : this.childrenIds)
abstract return getChildrenIdsreturn getChildrenIds(var0, 0)
abstract return getPathreturn getPath(var0, 0)
static int getValidatedOffsetint getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4)
static boolean hasChildrenIdsboolean hasChildrenIds(MemorySegment var0, int var1)
static boolean hasPathboolean hasPath(MemorySegment var0, int var1)
if if(var1 < 0)
if if(var3 == -1L)
if if(var5 > 4096000)
if if(var4 != var2)
if if(var9 == -1L)
if if(var11 > 4096000)
if if(var2 != null)
if if(this.path != null)
if if(this.childrenIds != null)
if if(this.path != null)
if if(this.childrenIds != null)
if if(this.childrenIds.length > 4096000)
if if(this.path != null)
if if(this.childrenIds != null)
if if(this == var1)
static void requireBoundsvoid requireBounds(MemorySegment var0, int var1)
abstract requireBounds requireBounds(var0, var1)
static void requireSlotvoid requireSlot(MemorySegment var0, int var1, int var2, String var3)
abstract requireSlot requireSlot(var0, var1 + 1, var4, "Path")
abstract requireSlot requireSlot(var0, var1 + 1, -1, "Path")
abstract requireSlot requireSlot(var0, var1 + 5, var4, "ChildrenIds")
abstract requireSlot requireSlot(var0, var1 + 5, -1, "ChildrenIds")
static AssetEditorRequestChildrenListReply toObjectAssetEditorRequestChildrenListReply toObject(MemorySegment var0)
static AssetEditorRequestChildrenListReply toObjectAssetEditorRequestChildrenListReply toObject(MemorySegment var0, int var1)
static AssetEditorRequestChildrenListReply toObjectAssetEditorRequestChildrenListReply 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.asseteditor;

class="kw">import com.hypixel.hytale.protocol.NetworkChannel;
class="kw">import com.hypixel.hytale.protocol.Packet;
class="kw">import com.hypixel.hytale.protocol.ToClientPacket;
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 java.util.Objects;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;

class="kw">public class AssetEditorRequestChildrenListReply class="kw">implements Packet, ToClientPacket {
   class="kw">public class="kw">static class="kw">final int PACKET_ID = 322;
   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 = 1;
   class="kw">public class="kw">static class="kw">final int FIXED_BLOCK_SIZE = 1;
   class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 2;
   class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 9;
   class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
   @Nullable
   class="kw">public AssetPath path;
   @Nullable
   class="kw">public String[] childrenIds;

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

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

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

   class="kw">public AssetEditorRequestChildrenListReply(@Nullable AssetPath var1, @Nullable String[] var2) {
      this.path = var1;
      this.childrenIds = var2;
   }

   class="kw">public AssetEditorRequestChildrenListReply(@Nonnull AssetEditorRequestChildrenListReply var1) {
      this.path = var1.path;
      this.childrenIds = var1.childrenIds;
   }

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

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

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

   @Nullable
   class="kw">public class="kw">static AssetPath getPath(MemorySegment var0, int var1) {
      class="kw">return hasPath(var0, var1) ? AssetPath.toObject(var0, var1 + getValidatedOffset(var0, var1, 1, 9, "Path")) : null;
   }

   @Nullable
   class="kw">public class="kw">static String[] getChildrenIds(MemorySegment var0) {
      class="kw">return getChildrenIds(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static String[] getChildrenIds(MemorySegment var0, int var1) {
      if (!hasChildrenIds(var0, var1)) {
         class="kw">return null;
      }

      int var2 = var1 + getValidatedOffset(var0, var1, 5, 9, "ChildrenIds");
      long var3 = VarInt.getWithLength(var0, var2);
      if (var3 == -1L) {
         throw ProtocolException.invalidVarInt("ChildrenIds");
      }

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

      int var6 = (int)(var3 >>> 32);
      if (var2 + var6 + var5 > var0.byteSize()) {
         throw ProtocolException.bufferTooSmall("ChildrenIds", Math.min(var2 + var6 + var5, Integer.MAX_VALUE), (int)var0.byteSize());
      }

      var2 += var6;
      String[] var7 = new String[var5];

      for (int var8 = 0; var8 < var5; var8++) {
         long var9 = VarInt.getWithLength(var0, var2);
         var7[var8] = PacketIO.readVarString("ChildrenIds", var0, var2, 0, 4096000, var9);
         var2 += (int)var9 + (int)(var9 >>> 32);
      }

      class="kw">return var7;
   }

   class="kw">public class="kw">static boolean hasPath(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 hasChildrenIds(MemorySegment var0, int var1) {
      byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
      class="kw">return (var2 & 2) != 0;
   }

   class="kw">private class="kw">static int getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4) {
      int var5 = var0.get(PacketIO.PROTO_INT, var1 + var2);
      if (var5 >= 0 && var5 <= var0.byteSize() - var1 - var3) {
         class="kw">return var3 + var5;
      } else {
         throw ProtocolException.invalidOffset(var4, var5, (int)var0.byteSize());
      }
   }

   class="kw">private class="kw">static void requireSlot(MemorySegment var0, int var1, int var2, String var3) {
      int var4 = var0.get(PacketIO.PROTO_INT, var1);
      if (var4 != var2) {
         throw ProtocolException.nonCanonicalLayout(var3, var4, var2);
      }
   }

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

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

   class="kw">public class="kw">static AssetEditorRequestChildrenListReply toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
      requireBounds(var0, var1);
      int var3 = var1 + 9;
      int var4 = 0;
      ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
      AssetPath var6 = null;
      if (hasPath(var0, var1)) {
         requireSlot(var0, var1 + 1, var4, "Path");
         var6 = AssetPath.toObject(var0, var3 + var4, var5);
         var4 = var5.position - var3;
      } else {
         requireSlot(var0, var1 + 1, -1, "Path");
      }

      String[] var7 = null;
      if (hasChildrenIds(var0, var1)) {
         requireSlot(var0, var1 + 5, var4, "ChildrenIds");
         int var8 = var3 + var4;
         long var9 = VarInt.getWithLength(var0, var8);
         if (var9 == -1L) {
            throw ProtocolException.invalidVarInt("ChildrenIds");
         }

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

         int var12 = (int)(var9 >>> 32);
         if (var8 + var12 + var11 > var0.byteSize()) {
            throw ProtocolException.bufferTooSmall("ChildrenIds", Math.min(var8 + var12 + var11, Integer.MAX_VALUE), (int)var0.byteSize());
         }

         var8 += var12;
         var7 = new String[var11];

         for (int var13 = 0; var13 < var11; var13++) {
            long var14 = VarInt.getWithLength(var0, var8);
            var7[var13] = PacketIO.readVarString("ChildrenIds", var0, var8, 0, 4096000, var14);
            var8 += (int)var14 + (int)(var14 >>> 32);
         }

         var4 = var8 - var3;
      } else {
         requireSlot(var0, var1 + 5, -1, "ChildrenIds");
      }

      AssetEditorRequestChildrenListReply var17 = new AssetEditorRequestChildrenListReply(var6, var7);
      if (var2 != null) {
         var2.position = var3 + var4;
      }

      class="kw">return var17;
   }

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

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

      var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
      int var4 = var2 + 9;
      if (this.path != null) {
         var1.set(PacketIO.PROTO_INT, var2 + 1, var4 - var2 - 9);
         var4 += this.path.serialize(var1, var4);
      } else {
         var1.set(PacketIO.PROTO_INT, var2 + 1, -1);
      }

      if (this.childrenIds != null) {
         var1.set(PacketIO.PROTO_INT, var2 + 5, var4 - var2 - 9);
         if (this.childrenIds.length > 4096000) {
            throw ProtocolException.arrayTooLong("ChildrenIds", this.childrenIds.length, 4096000);
         }

         var4 += VarInt.set(var1, var4, this.childrenIds.length);
         int var5 = 0;

         for (int var6 = 0; var6 < this.childrenIds.length; var6++) {
            var5 += PacketIO.writeVarString(var1, var4 + var5, this.childrenIds[var6], 4096000);
         }

         var4 += var5;
      } else {
         var1.set(PacketIO.PROTO_INT, var2 + 5, -1);
      }

      class="kw">return var4 - var2;
   }

   @Override
   class="kw">public int computeSize() {
      int var1 = 9;
      if (this.path != null) {
         var1 += this.path.computeSize();
      }

      if (this.childrenIds != null) {
         int var2 = 0;

         for (String var6 : this.childrenIds) {
            var2 += PacketIO.stringSize(var6);
         }

         var1 += VarInt.size(this.childrenIds.length) + var2;
      }

      class="kw">return var1;
   }

   class="kw">public AssetEditorRequestChildrenListReply clone() {
      AssetEditorRequestChildrenListReply var1 = new AssetEditorRequestChildrenListReply();
      var1.path = this.path != null ? this.path.clone() : null;
      var1.childrenIds = this.childrenIds != null ? Arrays.copyOf(this.childrenIds, this.childrenIds.length) : 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 AssetEditorRequestChildrenListReply var2)
            ? false
            : Objects.equals(this.path, var2.path) && Arrays.equals(this.childrenIds, var2.childrenIds);
      }
   }

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