UIComponentsUpdate class
Пакет: com.hypixel.hytale.protocol
Файл: com/hypixel/hytale/protocol/UIComponentsUpdate.java
extends: ComponentUpdate
Поля (20)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
NULLABLE_BIT_FIELD_SIZE |
|
int |
var1 |
|
UIComponentsUpdate |
var1 |
|
int |
var1 |
|
int |
var10 |
|
UIComponentsUpdate |
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 |
UIComponentsUpdate |
cloneUIComponentsUpdate clone() |
static |
int[] |
getComponentsint[] getComponents(MemorySegment var0) |
static |
int[] |
getComponentsint[] getComponents(MemorySegment var0, int var1) |
abstract |
return |
getComponentsreturn getComponents(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.components.length > 4096000) |
|
|
if if(this == var1) |
static |
void |
requireBoundsvoid requireBounds(MemorySegment var0, int var1) |
abstract |
|
requireBounds requireBounds(var0, var1) |
static |
UIComponentsUpdate |
toObjectUIComponentsUpdate toObject(MemorySegment var0) |
static |
UIComponentsUpdate |
toObjectUIComponentsUpdate toObject(MemorySegment var0, int var1) |
static |
UIComponentsUpdate |
toObjectUIComponentsUpdate 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 UIComponentsUpdate 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[] components = new int[0];
class="kw">public UIComponentsUpdate() {
}
class="kw">public UIComponentsUpdate(@Nonnull int[] var1) {
this.components = var1;
}
class="kw">public UIComponentsUpdate(@Nonnull UIComponentsUpdate var1) {
this.components = var1.components;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("UIComponentsUpdate", var1, (int)var0.byteSize());
}
long var2 = var1 + 0L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("UIComponentsUpdate", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static int[] getComponents(MemorySegment var0) {
class="kw">return getComponents(var0, 0);
}
class="kw">public class="kw">static int[] getComponents(MemorySegment var0, int var1) {
int var2 = var1 + 0;
long var3 = VarInt.getWithLength(var0, var2);
if (var3 == -1L) {
throw ProtocolException.invalidVarInt("Components");
}
int var5 = (int)var3;
if (var5 > 4096000) {
throw ProtocolException.arrayTooLong("Components", var5, 4096000);
}
int var6 = (int)(var3 >>> 32);
if (var2 + var6 + var5 * 4L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Components", (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 UIComponentsUpdate toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static UIComponentsUpdate toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static UIComponentsUpdate 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("Components");
}
int var9 = (int)var7;
if (var9 > 4096000) {
throw ProtocolException.arrayTooLong("Components", var9, 4096000);
}
int var10 = (int)(var7 >>> 32);
if (var6 + var10 + var9 * 4L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Components", (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;
UIComponentsUpdate var13 = new UIComponentsUpdate(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.components.length > 4096000) {
throw ProtocolException.arrayTooLong("Components", this.components.length, 4096000);
}
var3 += VarInt.set(var1, var3, this.components.length);
MemorySegment.copy(this.components, 0, var1, PacketIO.PROTO_INT, var3, this.components.length);
var3 += this.components.length * 4;
class="kw">return var3 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 0;
class="kw">return var1 + VarInt.size(this.components.length) + this.components.length * 4;
}
class="kw">public UIComponentsUpdate clone() {
UIComponentsUpdate var1 = new UIComponentsUpdate();
var1.components = Arrays.copyOf(this.components, this.components.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 UIComponentsUpdate var2 ? Arrays.equals(this.components, var2.components) : false;
}
}
@Override
class="kw">public int hashCode() {
int var1 = 1;
class="kw">return 31 * var1 + Arrays.hashCode(this.components);
}
}