Cloud class
Пакет: com.hypixel.hytale.protocol
Файл: com/hypixel/hytale/protocol/Cloud.java
Поля (50)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
NULLABLE_BIT_FIELD_SIZE |
|
int |
var1 |
|
Cloud |
var1 |
|
int |
var10 |
|
float |
var12 |
|
float |
var13 |
|
ColorAlpha |
var14 |
|
Map |
var15 |
|
|
var15 |
|
int |
var16 |
|
Map |
var19 |
|
|
var19 |
|
long |
var2 |
|
int |
var2 |
|
int |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
Map |
var2 |
|
int |
var20 |
|
Cloud |
var23 |
|
int |
var24 |
|
float |
var26 |
|
long |
var3 |
|
long |
var3 |
|
int |
var3 |
|
byte |
var3 |
|
|
var3 |
|
|
var3 |
|
|
var3 |
|
int |
var4 |
|
int |
var4 |
|
|
var4 |
|
|
var4 |
|
int |
var4 |
|
int |
var5 |
|
int |
var5 |
|
int |
var5 |
|
String |
var5 |
|
|
var5 |
|
Map |
var6 |
|
Map |
var6 |
|
int |
var6 |
|
long |
var7 |
|
float |
var8 |
|
float |
var8 |
|
long |
var8 |
|
float |
var9 |
|
ColorAlpha |
var9 |
|
long |
var9 |
Методы (50)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
Cloud |
cloneCloud clone() |
public |
int |
computeSizeint computeSize() |
|
|
for for(int var7 = 0; var7 < var5; var7++) |
|
|
for for(int var7 = 0; var7 < var5; var7++) |
|
|
for for(int var11 = 0; var11 < var10; var11++) |
|
|
for for(int var25 = 0; var25 < var24; var25++) |
abstract |
return |
getColorsreturn getColors(var0, 0) |
abstract |
return |
getSpeedsreturn getSpeeds(var0, 0) |
abstract |
return |
getTexturereturn getTexture(var0, 0) |
static |
int |
getValidatedOffsetint getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4) |
static |
boolean |
hasColorsboolean hasColors(MemorySegment var0, int var1) |
static |
boolean |
hasSpeedsboolean hasSpeeds(MemorySegment var0, int var1) |
static |
boolean |
hasTextureboolean hasTexture(MemorySegment var0, int var1) |
|
|
if if(var1 < 0) |
|
|
if if(var3 == -1L) |
|
|
if if(var5 > 4096000) |
|
|
if if(var3 == -1L) |
|
|
if if(var5 > 4096000) |
|
|
if if(var4 != var2) |
|
|
if if(var8 == -1L) |
|
|
if if(var10 > 4096000) |
|
|
if if(var9 == -1L) |
|
|
if if(var24 > 4096000) |
|
|
if if(var2 != null) |
|
|
if if(this.texture != null) |
|
|
if if(this.speeds != null) |
|
|
if if(this.colors != null) |
|
|
if if(this.texture != null) |
|
|
if if(this.speeds != null) |
|
|
if if(this.colors != null) |
|
|
if if(this.texture != null) |
|
|
if if(this.speeds != null) |
|
|
if if(this.colors != null) |
|
|
if if(this.colors != 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, "Texture") |
abstract |
|
requireSlot requireSlot(var0, var1 + 1, -1, "Texture") |
abstract |
|
requireSlot requireSlot(var0, var1 + 5, var4, "Speeds") |
abstract |
|
requireSlot requireSlot(var0, var1 + 5, -1, "Speeds") |
abstract |
|
requireSlot requireSlot(var0, var1 + 9, var4, "Colors") |
abstract |
|
requireSlot requireSlot(var0, var1 + 9, -1, "Colors") |
public |
int |
serializeint serialize(@Nonnull MemorySegment var1, int var2) |
static |
Cloud |
toObjectCloud toObject(MemorySegment var0) |
static |
Cloud |
toObjectCloud toObject(MemorySegment var0, int var1) |
static |
Cloud |
toObjectCloud 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.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 Cloud {
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 = 81920028;
@Nullable
class="kw">public String texture;
@Nullable
class="kw">public Map<Float, Float> speeds;
@Nullable
class="kw">public Map<Float, ColorAlpha> colors;
class="kw">public Cloud() {
}
class="kw">public Cloud(@Nullable String var1, @Nullable Map<Float, Float> var2, @Nullable Map<Float, ColorAlpha> var3) {
this.texture = var1;
this.speeds = var2;
this.colors = var3;
}
class="kw">public Cloud(@Nonnull Cloud var1) {
this.texture = var1.texture;
this.speeds = var1.speeds;
this.colors = var1.colors;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("Cloud", var1, (int)var0.byteSize());
}
long var2 = var1 + 13L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Cloud", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
@Nullable
class="kw">public class="kw">static String getTexture(MemorySegment var0) {
class="kw">return getTexture(var0, 0);
}
@Nullable
class="kw">public class="kw">static String getTexture(MemorySegment var0, int var1) {
class="kw">return hasTexture(var0, var1) ? PacketIO.readVarString("Texture", var0, var1 + getValidatedOffset(var0, var1, 1, 13, "Texture"), 4096000) : null;
}
@Nullable
class="kw">public class="kw">static Map<Float, Float> getSpeeds(MemorySegment var0) {
class="kw">return getSpeeds(var0, 0);
}
@Nullable
class="kw">public class="kw">static Map<Float, Float> getSpeeds(MemorySegment var0, int var1) {
if (!hasSpeeds(var0, var1)) {
class="kw">return null;
}
int var2 = var1 + getValidatedOffset(var0, var1, 5, 13, "Speeds");
long var3 = VarInt.getWithLength(var0, var2);
if (var3 == -1L) {
throw ProtocolException.invalidVarInt("Speeds");
}
int var5 = (int)var3;
if (var5 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Speeds", var5, 4096000);
}
var2 += (int)(var3 >>> 32);
if (var2 + var5 * 8L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Speeds", (int)Math.min(var2 + var5 * 8L, 2147483647L), (int)var0.byteSize());
}
Map var6 = new HashMap<>(var5);
for (int var7 = 0; var7 < var5; var7++) {
float var8 = var0.get(PacketIO.PROTO_FLOAT, var2);
var2 += 4;
float var9 = var0.get(PacketIO.PROTO_FLOAT, var2);
var2 += 4;
if (var6.put(var8, var9) != null) {
throw ProtocolException.duplicateKey("Speeds", var8);
}
}
class="kw">return var6;
}
@Nullable
class="kw">public class="kw">static Map<Float, ColorAlpha> getColors(MemorySegment var0) {
class="kw">return getColors(var0, 0);
}
@Nullable
class="kw">public class="kw">static Map<Float, ColorAlpha> getColors(MemorySegment var0, int var1) {
if (!hasColors(var0, var1)) {
class="kw">return null;
}
int var2 = var1 + getValidatedOffset(var0, var1, 9, 13, "Colors");
long var3 = VarInt.getWithLength(var0, var2);
if (var3 == -1L) {
throw ProtocolException.invalidVarInt("Colors");
}
int var5 = (int)var3;
if (var5 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Colors", var5, 4096000);
}
var2 += (int)(var3 >>> 32);
if (var2 + var5 * 8L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Colors", (int)Math.min(var2 + var5 * 8L, 2147483647L), (int)var0.byteSize());
}
Map var6 = new HashMap<>(var5);
for (int var7 = 0; var7 < var5; var7++) {
float var8 = var0.get(PacketIO.PROTO_FLOAT, var2);
var2 += 4;
ColorAlpha var9 = ColorAlpha.toObject(var0, var2);
var2 += 4;
if (var6.put(var8, var9) != null) {
throw ProtocolException.duplicateKey("Colors", var8);
}
}
class="kw">return var6;
}
class="kw">public class="kw">static boolean hasTexture(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 hasSpeeds(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 hasColors(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 Cloud toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static Cloud toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static Cloud toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 13;
int var4 = 0;
String var5 = null;
if (hasTexture(var0, var1)) {
requireSlot(var0, var1 + 1, var4, "Texture");
int var6 = var3 + var4;
long var7 = VarInt.getWithLength(var0, var6);
var5 = PacketIO.readVarString("Texture", var0, var6, 0, 4096000, var7);
var4 += (int)var7 + (int)(var7 >>> 32);
} else {
requireSlot(var0, var1 + 1, -1, "Texture");
}
Map var15 = null;
if (hasSpeeds(var0, var1)) {
requireSlot(var0, var1 + 5, var4, "Speeds");
int var16 = var3 + var4;
long var8 = VarInt.getWithLength(var0, var16);
if (var8 == -1L) {
throw ProtocolException.invalidVarInt("Speeds");
}
int var10 = (int)var8;
if (var10 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Speeds", var10, 4096000);
}
var16 += (int)(var8 >>> 32);
if (var16 + var10 * 8L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Speeds", (int)Math.min(var16 + var10 * 8L, 2147483647L), (int)var0.byteSize());
}
var15 = new HashMap<>(var10);
for (int var11 = 0; var11 < var10; var11++) {
float var12 = var0.get(PacketIO.PROTO_FLOAT, var16);
var16 += 4;
float var13 = var0.get(PacketIO.PROTO_FLOAT, var16);
var16 += 4;
if (var15.put(var12, var13) != null) {
throw ProtocolException.duplicateKey("Speeds", var12);
}
}
var4 = var16 - var3;
} else {
requireSlot(var0, var1 + 5, -1, "Speeds");
}
Map var19 = null;
if (hasColors(var0, var1)) {
requireSlot(var0, var1 + 9, var4, "Colors");
int var20 = var3 + var4;
long var9 = VarInt.getWithLength(var0, var20);
if (var9 == -1L) {
throw ProtocolException.invalidVarInt("Colors");
}
int var24 = (int)var9;
if (var24 > 4096000) {
throw ProtocolException.dictionaryTooLarge("Colors", var24, 4096000);
}
var20 += (int)(var9 >>> 32);
if (var20 + var24 * 8L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("Colors", (int)Math.min(var20 + var24 * 8L, 2147483647L), (int)var0.byteSize());
}
var19 = new HashMap<>(var24);
for (int var25 = 0; var25 < var24; var25++) {
float var26 = var0.get(PacketIO.PROTO_FLOAT, var20);
var20 += 4;
ColorAlpha var14 = ColorAlpha.toObject(var0, var20);
var20 += 4;
if (var19.put(var26, var14) != null) {
throw ProtocolException.duplicateKey("Colors", var26);
}
}
var4 = var20 - var3;
} else {
requireSlot(var0, var1 + 9, -1, "Colors");
}
Cloud var23 = new Cloud(var5, var15, var19);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var23;
}
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
byte var3 = 0;
if (this.texture != null) {
var3 = (byte)(var3 | 1);
}
if (this.speeds != null) {
var3 = (byte)(var3 | 2);
}
if (this.colors != null) {
var3 = (byte)(var3 | 4);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
int var4 = var2 + 13;
if (this.texture != null) {
var1.set(PacketIO.PROTO_INT, var2 + 1, var4 - var2 - 13);
var4 += PacketIO.writeVarString(var1, var4, this.texture, 4096000);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 1, -1);
}
if (this.speeds != null) {
var1.set(PacketIO.PROTO_INT, var2 + 5, var4 - var2 - 13);
if (this.speeds.size() > 4096000) {
throw ProtocolException.dictionaryTooLarge("Speeds", this.speeds.size(), 4096000);
}
var4 += VarInt.set(var1, var4, this.speeds.size());
for (Entry var6 : this.speeds.entrySet()) {
var1.set(PacketIO.PROTO_FLOAT, var4, var6.getKey());
var4 += 4;
var1.set(PacketIO.PROTO_FLOAT, var4, var6.getValue());
var4 += 4;
}
} else {
var1.set(PacketIO.PROTO_INT, var2 + 5, -1);
}
if (this.colors != null) {
var1.set(PacketIO.PROTO_INT, var2 + 9, var4 - var2 - 13);
if (this.colors.size() > 4096000) {
throw ProtocolException.dictionaryTooLarge("Colors", this.colors.size(), 4096000);
}
var4 += VarInt.set(var1, var4, this.colors.size());
for (Entry var10 : this.colors.entrySet()) {
var1.set(PacketIO.PROTO_FLOAT, var4, var10.getKey());
var4 += 4;
var4 += var10.getValue().serialize(var1, var4);
}
} else {
var1.set(PacketIO.PROTO_INT, var2 + 9, -1);
}
class="kw">return var4 - var2;
}
class="kw">public int computeSize() {
int var1 = 13;
if (this.texture != null) {
var1 += PacketIO.stringSize(this.texture);
}
if (this.speeds != null) {
var1 += VarInt.size(this.speeds.size()) + this.speeds.size() * 8;
}
if (this.colors != null) {
var1 += VarInt.size(this.colors.size()) + this.colors.size() * 8;
}
class="kw">return var1;
}
class="kw">public Cloud clone() {
Cloud var1 = new Cloud();
var1.texture = this.texture;
var1.speeds = this.speeds != null ? new HashMap<>(this.speeds) : null;
if (this.colors != null) {
Map var2 = new HashMap<>();
for (Entry var4 : this.colors.entrySet()) {
var2.put(var4.getKey(), var4.getValue().clone());
}
var1.colors = 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 Cloud var2)
? false
: Objects.equals(this.texture, var2.texture) && Objects.equals(this.speeds, var2.speeds) && Objects.equals(this.colors, var2.colors);
}
}
@Override
class="kw">public int hashCode() {
class="kw">return Objects.hash(this.texture, this.speeds, this.colors);
}
}