SetBlockAnimationSpeeds class
Пакет: com.hypixel.hytale.protocol.packets.world
Файл: com/hypixel/hytale/protocol/packets/world/SetBlockAnimationSpeeds.java
implements: Packet, ToClientPacket
Поля (25)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
PACKET_ID |
|
int |
var1 |
|
SetBlockAnimationSpeeds |
var1 |
|
int |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
int |
var10 |
|
SetBlockAnimationSpeeds |
var14 |
|
long |
var2 |
|
int |
var2 |
|
long |
var3 |
|
int |
var3 |
|
int |
var3 |
|
int |
var4 |
|
|
var4 |
|
int |
var4 |
|
int |
var5 |
|
BlockAnimationEntry[] |
var5 |
|
int |
var6 |
|
int |
var6 |
|
BlockAnimationEntry[] |
var7 |
|
long |
var7 |
|
int |
var9 |
Методы (34)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
SetBlockAnimationSpeeds |
cloneSetBlockAnimationSpeeds clone() |
|
|
for for(int var8 = 0; var8 < var5; var8++) |
|
|
for for(int var11 = 0; var11 < var9; var11++) |
|
|
for for(int var5 = 0; var5 < this.entries.length; var5++) |
static |
BlockAnimationEntry[] |
getEntriesBlockAnimationEntry[] getEntries(MemorySegment var0) |
static |
BlockAnimationEntry[] |
getEntriesBlockAnimationEntry[] getEntries(MemorySegment var0, int var1) |
abstract |
return |
getEntriesreturn getEntries(var0, 0) |
static |
long |
getRevisionlong getRevision(MemorySegment var0) |
static |
long |
getRevisionlong getRevision(MemorySegment var0, int var1) |
abstract |
return |
getRevisionreturn getRevision(var0, 0) |
static |
int |
getXint getX(MemorySegment var0) |
static |
int |
getXint getX(MemorySegment var0, int var1) |
abstract |
return |
getXreturn getX(var0, 0) |
static |
int |
getYint getY(MemorySegment var0) |
static |
int |
getYint getY(MemorySegment var0, int var1) |
abstract |
return |
getYreturn getY(var0, 0) |
static |
int |
getZint getZ(MemorySegment var0) |
static |
int |
getZint getZ(MemorySegment var0, int var1) |
abstract |
return |
getZreturn getZ(var0, 0) |
|
|
if if(var1 < 0) |
|
|
if if(var3 == -1L) |
|
|
if if(var5 > 32768) |
|
|
if if(var7 == -1L) |
|
|
if if(var9 > 32768) |
|
|
if if(var2 != null) |
|
|
if if(this.entries.length > 32768) |
|
|
if if(this == var1) |
static |
void |
requireBoundsvoid requireBounds(MemorySegment var0, int var1) |
abstract |
|
requireBounds requireBounds(var0, var1) |
static |
SetBlockAnimationSpeeds |
toObjectSetBlockAnimationSpeeds toObject(MemorySegment var0) |
static |
SetBlockAnimationSpeeds |
toObjectSetBlockAnimationSpeeds toObject(MemorySegment var0, int var1) |
static |
SetBlockAnimationSpeeds |
toObjectSetBlockAnimationSpeeds 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.world;
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 javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class SetBlockAnimationSpeeds class="kw">implements Packet, ToClientPacket {
class="kw">public class="kw">static class="kw">final int PACKET_ID = 253;
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 = 20;
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 = 20;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 557081;
class="kw">public int x;
class="kw">public int y;
class="kw">public int z;
class="kw">public long revision;
@Nonnull
class="kw">public BlockAnimationEntry[] entries = new BlockAnimationEntry[0];
@Override
class="kw">public int getId() {
class="kw">return 253;
}
@Override
class="kw">public NetworkChannel getChannel() {
class="kw">return NetworkChannel.Chunks;
}
class="kw">public SetBlockAnimationSpeeds() {
}
class="kw">public SetBlockAnimationSpeeds(int var1, int var2, int var3, long var4, @Nonnull BlockAnimationEntry[] var6) {
this.x = var1;
this.y = var2;
this.z = var3;
this.revision = var4;
this.entries = var6;
}
class="kw">public SetBlockAnimationSpeeds(@Nonnull SetBlockAnimationSpeeds var1) {
this.x = var1.x;
this.y = var1.y;
this.z = var1.z;
this.revision = var1.revision;
this.entries = var1.entries;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("SetBlockAnimationSpeeds", var1, (int)var0.byteSize());
}
long var2 = var1 + 20L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("SetBlockAnimationSpeeds", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static int getX(MemorySegment var0) {
class="kw">return getX(var0, 0);
}
class="kw">public class="kw">static int getX(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_INT, var1 + 0);
}
class="kw">public class="kw">static int getY(MemorySegment var0) {
class="kw">return getY(var0, 0);
}
class="kw">public class="kw">static int getY(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_INT, var1 + 4);
}
class="kw">public class="kw">static int getZ(MemorySegment var0) {
class="kw">return getZ(var0, 0);
}
class="kw">public class="kw">static int getZ(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_INT, var1 + 8);
}
class="kw">public class="kw">static long getRevision(MemorySegment var0) {
class="kw">return getRevision(var0, 0);
}
class="kw">public class="kw">static long getRevision(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_LONG, var1 + 12);
}
class="kw">public class="kw">static BlockAnimationEntry[] getEntries(MemorySegment var0) {
class="kw">return getEntries(var0, 0);
}
class="kw">public class="kw">static BlockAnimationEntry[] getEntries(MemorySegment var0, int var1) {
int var2 = var1 + 20;
long var3 = VarInt.getWithLength(var0, var2);
if (var3 == -1L) {
throw ProtocolException.invalidVarInt("Entries");
}
int var5 = (int)var3;
if (var5 > 32768) {
throw ProtocolException.arrayTooLong("Entries", var5, 32768);
}
int var6 = (int)(var3 >>> 32);
if (var2 + var6 + var5 * 17L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Entries", (int)Math.min(var2 + var6 + var5 * 17L, 2147483647L), (int)var0.byteSize());
}
var2 += var6;
BlockAnimationEntry[] var7 = new BlockAnimationEntry[var5];
for (int var8 = 0; var8 < var5; var8++) {
var7[var8] = BlockAnimationEntry.toObject(var0, var2 + var8 * 17);
}
class="kw">return var7;
}
class="kw">public class="kw">static SetBlockAnimationSpeeds toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static SetBlockAnimationSpeeds toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static SetBlockAnimationSpeeds toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 20;
int var4 = 0;
int var6 = var3 + var4;
long var7 = VarInt.getWithLength(var0, var6);
if (var7 == -1L) {
throw ProtocolException.invalidVarInt("Entries");
}
int var9 = (int)var7;
if (var9 > 32768) {
throw ProtocolException.arrayTooLong("Entries", var9, 32768);
}
int var10 = (int)(var7 >>> 32);
if (var6 + var10 + var9 * 17L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Entries", (int)Math.min(var6 + var10 + var9 * 17L, 2147483647L), (int)var0.byteSize());
}
var6 += var10;
BlockAnimationEntry[] var5 = new BlockAnimationEntry[var9];
for (int var11 = 0; var11 < var9; var11++) {
var5[var11] = BlockAnimationEntry.toObject(var0, var6 + var11 * 17);
}
var4 = var6 + var9 * 17 - var3;
SetBlockAnimationSpeeds var14 = new SetBlockAnimationSpeeds(
var0.get(PacketIO.PROTO_INT, var1 + 0),
var0.get(PacketIO.PROTO_INT, var1 + 4),
var0.get(PacketIO.PROTO_INT, var1 + 8),
var0.get(PacketIO.PROTO_LONG, var1 + 12),
var5
);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var14;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
var1.set(PacketIO.PROTO_INT, var2 + 0, this.x);
var1.set(PacketIO.PROTO_INT, var2 + 4, this.y);
var1.set(PacketIO.PROTO_INT, var2 + 8, this.z);
var1.set(PacketIO.PROTO_LONG, var2 + 12, this.revision);
int var3 = var2 + 20;
if (this.entries.length > 32768) {
throw ProtocolException.arrayTooLong("Entries", this.entries.length, 32768);
}
var3 += VarInt.set(var1, var3, this.entries.length);
int var4 = 0;
for (int var5 = 0; var5 < this.entries.length; var5++) {
var4 += this.entries[var5].serialize(var1, var3 + var4);
}
var3 += var4;
class="kw">return var3 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 20;
class="kw">return var1 + VarInt.size(this.entries.length) + this.entries.length * 17;
}
class="kw">public SetBlockAnimationSpeeds clone() {
SetBlockAnimationSpeeds var1 = new SetBlockAnimationSpeeds();
var1.x = this.x;
var1.y = this.y;
var1.z = this.z;
var1.revision = this.revision;
var1.entries = Arrays.stream(this.entries).map(var0 -> var0.clone()).toArray(BlockAnimationEntry[]::new);
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 SetBlockAnimationSpeeds var2)
? false
: this.x == var2.x && this.y == var2.y && this.z == var2.z && this.revision == var2.revision && Arrays.equals(this.entries, var2.entries);
}
}
@Override
class="kw">public int hashCode() {
int var1 = 1;
var1 = 31 * var1 + Integer.hashCode(this.x);
var1 = 31 * var1 + Integer.hashCode(this.y);
var1 = 31 * var1 + Integer.hashCode(this.z);
var1 = 31 * var1 + Long.hashCode(this.revision);
class="kw">return 31 * var1 + Arrays.hashCode(this.entries);
}
}