AssetEditorAssetListUpdate class
Пакет: com.hypixel.hytale.protocol.packets.asseteditor
Файл: com/hypixel/hytale/protocol/packets/asseteditor/AssetEditorAssetListUpdate.java
implements: Packet, ToClientPacket
Поля (59)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
PACKET_ID |
|
int |
var1 |
|
AssetEditorAssetListUpdate |
var1 |
|
int |
var1 |
|
|
var1 |
|
|
var1 |
|
long |
var10 |
|
int |
var11 |
|
int |
var12 |
|
AssetEditorFileEntry[] |
var15 |
|
|
var15 |
|
int |
var16 |
|
|
var16 |
|
AssetEditorFileEntry[] |
var18 |
|
|
var18 |
|
int |
var19 |
|
|
var19 |
|
long |
var2 |
|
ReadCursor |
var2 |
|
ReadCursor |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
int |
var2 |
|
AssetEditorAssetListUpdate |
var21 |
|
int |
var22 |
|
int |
var23 |
|
int |
var3 |
|
|
var3 |
|
int |
var3 |
|
|
var3 |
|
int |
var3 |
|
byte |
var3 |
|
|
var3 |
|
|
var3 |
|
|
var3 |
|
long |
var4 |
|
long |
var4 |
|
int |
var4 |
|
int |
var4 |
|
|
var4 |
|
|
var4 |
|
int |
var4 |
|
int |
var5 |
|
ReadCursor |
var5 |
|
int |
var5 |
|
int |
var6 |
|
int |
var6 |
|
String |
var6 |
|
|
var6 |
|
int |
var7 |
|
int |
var7 |
|
int |
var7 |
|
int |
var7 |
|
AssetEditorFileEntry[] |
var8 |
|
AssetEditorFileEntry[] |
var8 |
|
long |
var8 |
|
long |
var9 |
|
int |
var9 |
Методы (53)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
AssetEditorAssetListUpdate |
cloneAssetEditorAssetListUpdate clone() |
|
|
for for(int var9 = 0; var9 < var6; var9++) |
|
|
for for(int var9 = 0; var9 < var6; var9++) |
|
|
for for(int var13 = 0; var13 < var11; var13++) |
|
|
for for(int var14 = 0; var14 < var22; var14++) |
|
|
for for(int var6 = 0; var6 < this.additions.length; var6++) |
|
|
for for(int var10 = 0; var10 < this.deletions.length; var10++) |
|
|
for for(AssetEditorFileEntry var6 : this.additions) |
|
|
for for(AssetEditorFileEntry var11 : this.deletions) |
abstract |
return |
getAdditionsreturn getAdditions(var0, 0) |
abstract |
return |
getDeletionsreturn getDeletions(var0, 0) |
abstract |
return |
getPackreturn getPack(var0, 0) |
static |
int |
getValidatedOffsetint getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4) |
static |
boolean |
hasAdditionsboolean hasAdditions(MemorySegment var0, int var1) |
static |
boolean |
hasDeletionsboolean hasDeletions(MemorySegment var0, int var1) |
static |
boolean |
hasPackboolean hasPack(MemorySegment var0, int var1) |
|
|
if if(var1 < 0) |
|
|
if if(var4 == -1L) |
|
|
if if(var6 > 4096000) |
|
|
if if(var4 == -1L) |
|
|
if if(var6 > 4096000) |
|
|
if if(var4 != var2) |
|
|
if if(var9 == -1L) |
|
|
if if(var11 > 4096000) |
|
|
if if(var10 == -1L) |
|
|
if if(var22 > 4096000) |
|
|
if if(var2 != null) |
|
|
if if(this.pack != null) |
|
|
if if(this.additions != null) |
|
|
if if(this.deletions != null) |
|
|
if if(this.pack != null) |
|
|
if if(this.additions != null) |
|
|
if if(this.additions.length > 4096000) |
|
|
if if(this.deletions != null) |
|
|
if if(this.deletions.length > 4096000) |
|
|
if if(this.pack != null) |
|
|
if if(this.additions != null) |
|
|
if if(this.deletions != 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, "Pack") |
abstract |
|
requireSlot requireSlot(var0, var1 + 1, -1, "Pack") |
abstract |
|
requireSlot requireSlot(var0, var1 + 5, var4, "Additions") |
abstract |
|
requireSlot requireSlot(var0, var1 + 5, -1, "Additions") |
abstract |
|
requireSlot requireSlot(var0, var1 + 9, var4, "Deletions") |
abstract |
|
requireSlot requireSlot(var0, var1 + 9, -1, "Deletions") |
static |
AssetEditorAssetListUpdate |
toObjectAssetEditorAssetListUpdate toObject(MemorySegment var0) |
static |
AssetEditorAssetListUpdate |
toObjectAssetEditorAssetListUpdate toObject(MemorySegment var0, int var1) |
static |
AssetEditorAssetListUpdate |
toObjectAssetEditorAssetListUpdate 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 AssetEditorAssetListUpdate class="kw">implements Packet, ToClientPacket {
class="kw">public class="kw">static class="kw">final int PACKET_ID = 320;
class="kw">public class="kw">static class="kw">final boolean IS_COMPRESSED = true;
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 = 3;
class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 13;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
@Nullable
class="kw">public String pack;
@Nullable
class="kw">public AssetEditorFileEntry[] additions;
@Nullable
class="kw">public AssetEditorFileEntry[] deletions;
@Override
class="kw">public int getId() {
class="kw">return 320;
}
@Override
class="kw">public NetworkChannel getChannel() {
class="kw">return NetworkChannel.Default;
}
class="kw">public AssetEditorAssetListUpdate() {
}
class="kw">public AssetEditorAssetListUpdate(@Nullable String var1, @Nullable AssetEditorFileEntry[] var2, @Nullable AssetEditorFileEntry[] var3) {
this.pack = var1;
this.additions = var2;
this.deletions = var3;
}
class="kw">public AssetEditorAssetListUpdate(@Nonnull AssetEditorAssetListUpdate var1) {
this.pack = var1.pack;
this.additions = var1.additions;
this.deletions = var1.deletions;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("AssetEditorAssetListUpdate", var1, (int)var0.byteSize());
}
long var2 = var1 + 13L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("AssetEditorAssetListUpdate", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
@Nullable
class="kw">public class="kw">static String getPack(MemorySegment var0) {
class="kw">return getPack(var0, 0);
}
@Nullable
class="kw">public class="kw">static String getPack(MemorySegment var0, int var1) {
class="kw">return hasPack(var0, var1) ? PacketIO.readVarString("Pack", var0, var1 + getValidatedOffset(var0, var1, 1, 13, "Pack"), 4096000) : null;
}
@Nullable
class="kw">public class="kw">static AssetEditorFileEntry[] getAdditions(MemorySegment var0) {
class="kw">return getAdditions(var0, 0);
}
@Nullable
class="kw">public class="kw">static AssetEditorFileEntry[] getAdditions(MemorySegment var0, int var1) {
if (!hasAdditions(var0, var1)) {
class="kw">return null;
}
ReadCursor var2 = new ReadCursor();
int var3 = var1 + getValidatedOffset(var0, var1, 5, 13, "Additions");
long var4 = VarInt.getWithLength(var0, var3);
if (var4 == -1L) {
throw ProtocolException.invalidVarInt("Additions");
}
int var6 = (int)var4;
if (var6 > 4096000) {
throw ProtocolException.arrayTooLong("Additions", var6, 4096000);
}
int var7 = (int)(var4 >>> 32);
if (var3 + var7 + var6 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Additions", (int)Math.min(var3 + var7 + var6 * 2L, 2147483647L), (int)var0.byteSize());
}
var3 += var7;
AssetEditorFileEntry[] var8 = new AssetEditorFileEntry[var6];
for (int var9 = 0; var9 < var6; var9++) {
var8[var9] = AssetEditorFileEntry.toObject(var0, var3, var2);
var3 = var2.position;
}
class="kw">return var8;
}
@Nullable
class="kw">public class="kw">static AssetEditorFileEntry[] getDeletions(MemorySegment var0) {
class="kw">return getDeletions(var0, 0);
}
@Nullable
class="kw">public class="kw">static AssetEditorFileEntry[] getDeletions(MemorySegment var0, int var1) {
if (!hasDeletions(var0, var1)) {
class="kw">return null;
}
ReadCursor var2 = new ReadCursor();
int var3 = var1 + getValidatedOffset(var0, var1, 9, 13, "Deletions");
long var4 = VarInt.getWithLength(var0, var3);
if (var4 == -1L) {
throw ProtocolException.invalidVarInt("Deletions");
}
int var6 = (int)var4;
if (var6 > 4096000) {
throw ProtocolException.arrayTooLong("Deletions", var6, 4096000);
}
int var7 = (int)(var4 >>> 32);
if (var3 + var7 + var6 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Deletions", (int)Math.min(var3 + var7 + var6 * 2L, 2147483647L), (int)var0.byteSize());
}
var3 += var7;
AssetEditorFileEntry[] var8 = new AssetEditorFileEntry[var6];
for (int var9 = 0; var9 < var6; var9++) {
var8[var9] = AssetEditorFileEntry.toObject(var0, var3, var2);
var3 = var2.position;
}
class="kw">return var8;
}
class="kw">public class="kw">static boolean hasPack(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 hasAdditions(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 hasDeletions(MemorySegment var0, int var1) {
byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
class="kw">return (var2 & 4) != 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 AssetEditorAssetListUpdate toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static AssetEditorAssetListUpdate toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static AssetEditorAssetListUpdate toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 13;
int var4 = 0;
ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
String var6 = null;
if (hasPack(var0, var1)) {
requireSlot(var0, var1 + 1, var4, "Pack");
int var7 = var3 + var4;
long var8 = VarInt.getWithLength(var0, var7);
var6 = PacketIO.readVarString("Pack", var0, var7, 0, 4096000, var8);
var4 += (int)var8 + (int)(var8 >>> 32);
} else {
requireSlot(var0, var1 + 1, -1, "Pack");
}
AssetEditorFileEntry[] var15 = null;
if (hasAdditions(var0, var1)) {
requireSlot(var0, var1 + 5, var4, "Additions");
int var16 = var3 + var4;
long var9 = VarInt.getWithLength(var0, var16);
if (var9 == -1L) {
throw ProtocolException.invalidVarInt("Additions");
}
int var11 = (int)var9;
if (var11 > 4096000) {
throw ProtocolException.arrayTooLong("Additions", var11, 4096000);
}
int var12 = (int)(var9 >>> 32);
if (var16 + var12 + var11 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Additions", (int)Math.min(var16 + var12 + var11 * 2L, 2147483647L), (int)var0.byteSize());
}
var16 += var12;
var15 = new AssetEditorFileEntry[var11];
for (int var13 = 0; var13 < var11; var13++) {
var15[var13] = AssetEditorFileEntry.toObject(var0, var16, var5);
var16 = var5.position;
}
var4 = var16 - var3;
} else {
requireSlot(var0, var1 + 5, -1, "Additions");
}
AssetEditorFileEntry[] var18 = null;
if (hasDeletions(var0, var1)) {
requireSlot(var0, var1 + 9, var4, "Deletions");
int var19 = var3 + var4;
long var10 = VarInt.getWithLength(var0, var19);
if (var10 == -1L) {
throw ProtocolException.invalidVarInt("Deletions");
}
int var22 = (int)var10;
if (var22 > 4096000) {
throw ProtocolException.arrayTooLong("Deletions", var22, 4096000);
}
int var23 = (int)(var10 >>> 32);
if (var19 + var23 + var22 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Deletions", (int)Math.min(var19 + var23 + var22 * 2L, 2147483647L), (int)var0.byteSize());
}
var19 += var23;
var18 = new AssetEditorFileEntry[var22];
for (int var14 = 0; var14 < var22; var14++) {
var18[var14] = AssetEditorFileEntry.toObject(var0, var19, var5);
var19 = var5.position;
}
var4 = var19 - var3;
} else {
requireSlot(var0, var1 + 9, -1, "Deletions");
}
AssetEditorAssetListUpdate var21 = new AssetEditorAssetListUpdate(var6, var15, var18);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var21;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
byte var3 = 0;
if (this.pack != null) {
var3 = (byte)(var3 | 1);
}
if (this.additions != null) {
var3 = (byte)(var3 | 2);
}
if (this.deletions != null) {
var3 = (byte)(var3 | 4);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
int var4 = var2 + 13;
if (this.pack != null) {
var1.set(PacketIO.PROTO_INT, var2 + 1, var4 - var2 - 13);
var4 += PacketIO.writeVarString(var1, var4, this.pack, 4096000);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 1, -1);
}
if (this.additions != null) {
var1.set(PacketIO.PROTO_INT, var2 + 5, var4 - var2 - 13);
if (this.additions.length > 4096000) {
throw ProtocolException.arrayTooLong("Additions", this.additions.length, 4096000);
}
var4 += VarInt.set(var1, var4, this.additions.length);
int var5 = 0;
for (int var6 = 0; var6 < this.additions.length; var6++) {
var5 += this.additions[var6].serialize(var1, var4 + var5);
}
var4 += var5;
} else {
var1.set(PacketIO.PROTO_INT, var2 + 5, -1);
}
if (this.deletions != null) {
var1.set(PacketIO.PROTO_INT, var2 + 9, var4 - var2 - 13);
if (this.deletions.length > 4096000) {
throw ProtocolException.arrayTooLong("Deletions", this.deletions.length, 4096000);
}
var4 += VarInt.set(var1, var4, this.deletions.length);
int var9 = 0;
for (int var10 = 0; var10 < this.deletions.length; var10++) {
var9 += this.deletions[var10].serialize(var1, var4 + var9);
}
var4 += var9;
} else {
var1.set(PacketIO.PROTO_INT, var2 + 9, -1);
}
class="kw">return var4 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 13;
if (this.pack != null) {
var1 += PacketIO.stringSize(this.pack);
}
if (this.additions != null) {
int var2 = 0;
for (AssetEditorFileEntry var6 : this.additions) {
var2 += var6.computeSize();
}
var1 += VarInt.size(this.additions.length) + var2;
}
if (this.deletions != null) {
int var7 = 0;
for (AssetEditorFileEntry var11 : this.deletions) {
var7 += var11.computeSize();
}
var1 += VarInt.size(this.deletions.length) + var7;
}
class="kw">return var1;
}
class="kw">public AssetEditorAssetListUpdate clone() {
AssetEditorAssetListUpdate var1 = new AssetEditorAssetListUpdate();
var1.pack = this.pack;
var1.additions = this.additions != null ? Arrays.stream(this.additions).map(var0 -> var0.clone()).toArray(AssetEditorFileEntry[]::new) : null;
var1.deletions = this.deletions != null ? Arrays.stream(this.deletions).map(var0 -> var0.clone()).toArray(AssetEditorFileEntry[]::new) : 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 AssetEditorAssetListUpdate var2)
? false
: Objects.equals(this.pack, var2.pack) && Arrays.equals(this.additions, var2.additions) && Arrays.equals(this.deletions, var2.deletions);
}
}
@Override
class="kw">public int hashCode() {
int var1 = 1;
var1 = 31 * var1 + Objects.hashCode(this.pack);
var1 = 31 * var1 + Arrays.hashCode(this.additions);
class="kw">return 31 * var1 + Arrays.hashCode(this.deletions);
}
}