UpdateViewBobbing class
Пакет: com.hypixel.hytale.protocol.packets.assets
Файл: com/hypixel/hytale/protocol/packets/assets/UpdateViewBobbing.java
implements: Packet, ToClientPacket
Поля (28)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
PACKET_ID |
|
int |
var1 |
|
UpdateViewBobbing |
var1 |
|
ViewBobbing |
var10 |
|
int |
var10 |
|
MovementType |
var12 |
|
ViewBobbing |
var13 |
|
UpdateViewBobbing |
var17 |
|
long |
var2 |
|
ReadCursor |
var2 |
|
int |
var2 |
|
Map |
var2 |
|
int |
var3 |
|
|
var3 |
|
int |
var3 |
|
int |
var3 |
|
|
var3 |
|
long |
var4 |
|
int |
var4 |
|
|
var4 |
|
ReadCursor |
var5 |
|
int |
var6 |
|
Map |
var6 |
|
Map |
var7 |
|
int |
var7 |
|
|
var7 |
|
long |
var8 |
|
MovementType |
var9 |
Методы (23)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
UpdateViewBobbing |
cloneUpdateViewBobbing clone() |
|
|
for for(int var8 = 0; var8 < var6; var8++) |
|
|
for for(int var11 = 0; var11 < var10; var11++) |
static |
Map<MovementType, ViewBobbing> |
getProfilesMap<MovementType, ViewBobbing> getProfiles(MemorySegment var0) |
static |
Map<MovementType, ViewBobbing> |
getProfilesMap<MovementType, ViewBobbing> getProfiles(MemorySegment var0, int var1) |
abstract |
return |
getProfilesreturn getProfiles(var0, 0) |
static |
UpdateType |
getTypeUpdateType getType(MemorySegment var0) |
static |
UpdateType |
getTypeUpdateType getType(MemorySegment var0, int var1) |
abstract |
return |
getTypereturn getType(var0, 0) |
|
|
if if(var1 < 0) |
|
|
if if(var4 == -1L) |
|
|
if if(var6 > 4096000) |
|
|
if if(var8 == -1L) |
|
|
if if(var10 > 4096000) |
|
|
if if(var2 != null) |
|
|
if if(this == var1) |
static |
void |
requireBoundsvoid requireBounds(MemorySegment var0, int var1) |
abstract |
|
requireBounds requireBounds(var0, var1) |
static |
UpdateViewBobbing |
toObjectUpdateViewBobbing toObject(MemorySegment var0) |
static |
UpdateViewBobbing |
toObjectUpdateViewBobbing toObject(MemorySegment var0, int var1) |
static |
UpdateViewBobbing |
toObjectUpdateViewBobbing 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.assets;
class="kw">import com.hypixel.hytale.protocol.MovementType;
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.UpdateType;
class="kw">import com.hypixel.hytale.protocol.ViewBobbing;
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.HashMap;
class="kw">import java.util.Map;
class="kw">import java.util.Objects;
class="kw">import java.util.Map.Entry;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class UpdateViewBobbing class="kw">implements Packet, ToClientPacket {
class="kw">public class="kw">static class="kw">final int PACKET_ID = 76;
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 = 0;
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 = 1;
class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 1;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
@Nonnull
class="kw">public UpdateType type = UpdateType.Init;
@Nonnull
class="kw">public Map<MovementType, ViewBobbing> profiles = new HashMap<>();
@Override
class="kw">public int getId() {
class="kw">return 76;
}
@Override
class="kw">public NetworkChannel getChannel() {
class="kw">return NetworkChannel.Default;
}
class="kw">public UpdateViewBobbing() {
}
class="kw">public UpdateViewBobbing(@Nonnull UpdateType var1, @Nonnull Map<MovementType, ViewBobbing> var2) {
this.type = var1;
this.profiles = var2;
}
class="kw">public UpdateViewBobbing(@Nonnull UpdateViewBobbing var1) {
this.type = var1.type;
this.profiles = var1.profiles;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("UpdateViewBobbing", var1, (int)var0.byteSize());
}
long var2 = var1 + 1L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("UpdateViewBobbing", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static UpdateType getType(MemorySegment var0) {
class="kw">return getType(var0, 0);
}
class="kw">public class="kw">static UpdateType getType(MemorySegment var0, int var1) {
class="kw">return UpdateType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 0));
}
class="kw">public class="kw">static Map<MovementType, ViewBobbing> getProfiles(MemorySegment var0) {
class="kw">return getProfiles(var0, 0);
}
class="kw">public class="kw">static Map<MovementType, ViewBobbing> getProfiles(MemorySegment var0, int var1) {
ReadCursor var2 = new ReadCursor();
int var3 = var1 + 1;
long var4 = VarInt.getWithLength(var0, var3);
if (var4 == -1L) {
throw ProtocolException.invalidVarInt("Profiles");
}
int var6 = (int)var4;
if (var6 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Profiles", var6, 4096000);
}
var3 += (int)(var4 >>> 32);
if (var3 + var6 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Profiles", (int)Math.min(var3 + var6 * 2L, 2147483647L), (int)var0.byteSize());
}
Map var7 = new HashMap<>(var6);
for (int var8 = 0; var8 < var6; var8++) {
MovementType var9 = MovementType.fromValue(var0.get(PacketIO.PROTO_BYTE, var3));
ViewBobbing var10 = ViewBobbing.toObject(var0, ++var3, var2);
var3 = var2.position;
if (var7.put(var9, var10) != null) {
throw ProtocolException.duplicateKey("Profiles", var9);
}
}
class="kw">return var7;
}
class="kw">public class="kw">static UpdateViewBobbing toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static UpdateViewBobbing toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static UpdateViewBobbing toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 1;
int var4 = 0;
ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
int var7 = var3 + var4;
long var8 = VarInt.getWithLength(var0, var7);
if (var8 == -1L) {
throw ProtocolException.invalidVarInt("Profiles");
}
int var10 = (int)var8;
if (var10 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Profiles", var10, 4096000);
}
var7 += (int)(var8 >>> 32);
if (var7 + var10 * 2L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Profiles", (int)Math.min(var7 + var10 * 2L, 2147483647L), (int)var0.byteSize());
}
Map var6 = new HashMap<>(var10);
for (int var11 = 0; var11 < var10; var11++) {
MovementType var12 = MovementType.fromValue(var0.get(PacketIO.PROTO_BYTE, var7));
ViewBobbing var13 = ViewBobbing.toObject(var0, ++var7, var5);
var7 = var5.position;
if (var6.put(var12, var13) != null) {
throw ProtocolException.duplicateKey("Profiles", var12);
}
}
var4 = var7 - var3;
UpdateViewBobbing var17 = new UpdateViewBobbing(UpdateType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 0)), var6);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var17;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
var1.set(PacketIO.PROTO_BYTE, var2 + 0, (byte)this.type.getValue());
int var3 = var2 + 1;
if (this.profiles.size() > 4096000) {
throw ProtocolException.dictionaryTooLarge("Profiles", this.profiles.size(), 4096000);
}
var3 += VarInt.set(var1, var3, this.profiles.size());
for (Entry var5 : this.profiles.entrySet()) {
var1.set(PacketIO.PROTO_BYTE, var3, (byte)var5.getKey().getValue());
var3 = ++var3 + var5.getValue().serialize(var1, var3);
}
class="kw">return var3 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 1;
int var2 = 0;
for (Entry var4 : this.profiles.entrySet()) {
var2 += 1 + var4.getValue().computeSize();
}
class="kw">return var1 + VarInt.size(this.profiles.size()) + var2;
}
class="kw">public UpdateViewBobbing clone() {
UpdateViewBobbing var1 = new UpdateViewBobbing();
var1.type = this.type;
Map var2 = new HashMap<>();
for (Entry var4 : this.profiles.entrySet()) {
var2.put(var4.getKey(), var4.getValue().clone());
}
var1.profiles = var2;
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 UpdateViewBobbing var2) ? false : Objects.equals(this.type, var2.type) && Objects.equals(this.profiles, var2.profiles);
}
}
@Override
class="kw">public int hashCode() {
class="kw">return Objects.hash(this.type, this.profiles);
}
}