InteractionCooldown class
Пакет: com.hypixel.hytale.protocol
Файл: com/hypixel/hytale/protocol/InteractionCooldown.java
Поля (40)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
NULLABLE_BIT_FIELD_SIZE |
|
int |
var1 |
|
InteractionCooldown |
var1 |
|
int |
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
|
var1 |
|
int |
var10 |
|
int |
var11 |
|
float[] |
var12 |
|
|
var12 |
|
int |
var13 |
|
InteractionCooldown |
var15 |
|
long |
var2 |
|
int |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
long |
var3 |
|
int |
var3 |
|
byte |
var3 |
|
|
var3 |
|
|
var3 |
|
int |
var4 |
|
int |
var4 |
|
|
var4 |
|
byte |
var4 |
|
|
var4 |
|
|
var4 |
|
int |
var5 |
|
int |
var5 |
|
String |
var5 |
|
|
var5 |
|
int |
var5 |
|
int |
var6 |
|
int |
var6 |
|
float[] |
var7 |
|
long |
var7 |
|
long |
var8 |
Методы (49)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
InteractionCooldown |
cloneInteractionCooldown clone() |
public |
int |
computeSizeint computeSize() |
abstract |
return |
getChargeTimesreturn getChargeTimes(var0, 0) |
static |
boolean |
getClickBypassboolean getClickBypass(MemorySegment var0) |
static |
boolean |
getClickBypassboolean getClickBypass(MemorySegment var0, int var1) |
abstract |
return |
getClickBypassreturn getClickBypass(var0, 0) |
static |
float |
getCooldownfloat getCooldown(MemorySegment var0) |
static |
float |
getCooldownfloat getCooldown(MemorySegment var0, int var1) |
abstract |
return |
getCooldownreturn getCooldown(var0, 0) |
abstract |
return |
getCooldownIdreturn getCooldownId(var0, 0) |
static |
boolean |
getInterruptRechargeboolean getInterruptRecharge(MemorySegment var0) |
static |
boolean |
getInterruptRechargeboolean getInterruptRecharge(MemorySegment var0, int var1) |
abstract |
return |
getInterruptRechargereturn getInterruptRecharge(var0, 0) |
static |
boolean |
getSkipCooldownResetboolean getSkipCooldownReset(MemorySegment var0) |
static |
boolean |
getSkipCooldownResetboolean getSkipCooldownReset(MemorySegment var0, int var1) |
abstract |
return |
getSkipCooldownResetreturn getSkipCooldownReset(var0, 0) |
static |
int |
getValidatedOffsetint getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4) |
static |
boolean |
hasChargeTimesboolean hasChargeTimes(MemorySegment var0, int var1) |
static |
boolean |
hasCooldownIdboolean hasCooldownId(MemorySegment var0, int var1) |
|
|
if if(var1 < 0) |
|
|
if if(var3 == -1L) |
|
|
if if(var5 > 4096000) |
|
|
if if(var4 != var2) |
|
|
if if(var8 == -1L) |
|
|
if if(var10 > 4096000) |
|
|
if if(var2 != null) |
|
|
if if(this.cooldownId != null) |
|
|
if if(this.chargeTimes != null) |
|
|
if if(this.skipCooldownReset) |
|
|
if if(this.interruptRecharge) |
|
|
if if(this.cooldownId != null) |
|
|
if if(this.chargeTimes != null) |
|
|
if if(this.chargeTimes.length > 4096000) |
|
|
if if(this.cooldownId != null) |
|
|
if if(this.chargeTimes != 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 + 7, var4, "CooldownId") |
abstract |
|
requireSlot requireSlot(var0, var1 + 7, -1, "CooldownId") |
abstract |
|
requireSlot requireSlot(var0, var1 + 11, var4, "ChargeTimes") |
abstract |
|
requireSlot requireSlot(var0, var1 + 11, -1, "ChargeTimes") |
public |
int |
serializeint serialize(@Nonnull MemorySegment var1, int var2) |
static |
InteractionCooldown |
toObjectInteractionCooldown toObject(MemorySegment var0) |
static |
InteractionCooldown |
toObjectInteractionCooldown toObject(MemorySegment var0, int var1) |
static |
InteractionCooldown |
toObjectInteractionCooldown 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 java.util.Objects;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class InteractionCooldown {
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 = 7;
class="kw">public class="kw">static class="kw">final int VARIABLE_FIELD_COUNT = 2;
class="kw">public class="kw">static class="kw">final int VARIABLE_BLOCK_START = 15;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 32768025;
@Nullable
class="kw">public String cooldownId;
class="kw">public float cooldown;
class="kw">public boolean clickBypass;
@Nullable
class="kw">public float[] chargeTimes;
class="kw">public boolean skipCooldownReset;
class="kw">public boolean interruptRecharge;
class="kw">public InteractionCooldown() {
}
class="kw">public InteractionCooldown(@Nullable String var1, float var2, boolean var3, @Nullable float[] var4, boolean var5, boolean var6) {
this.cooldownId = var1;
this.cooldown = var2;
this.clickBypass = var3;
this.chargeTimes = var4;
this.skipCooldownReset = var5;
this.interruptRecharge = var6;
}
class="kw">public InteractionCooldown(@Nonnull InteractionCooldown var1) {
this.cooldownId = var1.cooldownId;
this.cooldown = var1.cooldown;
this.clickBypass = var1.clickBypass;
this.chargeTimes = var1.chargeTimes;
this.skipCooldownReset = var1.skipCooldownReset;
this.interruptRecharge = var1.interruptRecharge;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("InteractionCooldown", var1, (int)var0.byteSize());
}
long var2 = var1 + 15L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("InteractionCooldown", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
@Nullable
class="kw">public class="kw">static String getCooldownId(MemorySegment var0) {
class="kw">return getCooldownId(var0, 0);
}
@Nullable
class="kw">public class="kw">static String getCooldownId(MemorySegment var0, int var1) {
class="kw">return hasCooldownId(var0, var1) ? PacketIO.readVarString("CooldownId", var0, var1 + getValidatedOffset(var0, var1, 7, 15, "CooldownId"), 4096000) : null;
}
class="kw">public class="kw">static float getCooldown(MemorySegment var0) {
class="kw">return getCooldown(var0, 0);
}
class="kw">public class="kw">static float getCooldown(MemorySegment var0, int var1) {
class="kw">return PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 1), "Cooldown");
}
class="kw">public class="kw">static boolean getClickBypass(MemorySegment var0) {
class="kw">return getClickBypass(var0, 0);
}
class="kw">public class="kw">static boolean getClickBypass(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_BOOL, var1 + 5);
}
@Nullable
class="kw">public class="kw">static float[] getChargeTimes(MemorySegment var0) {
class="kw">return getChargeTimes(var0, 0);
}
@Nullable
class="kw">public class="kw">static float[] getChargeTimes(MemorySegment var0, int var1) {
if (!hasChargeTimes(var0, var1)) {
class="kw">return null;
}
int var2 = var1 + getValidatedOffset(var0, var1, 11, 15, "ChargeTimes");
long var3 = VarInt.getWithLength(var0, var2);
if (var3 == -1L) {
throw ProtocolException.invalidVarInt("ChargeTimes");
}
int var5 = (int)var3;
if (var5 > 4096000) {
throw ProtocolException.arrayTooLong("ChargeTimes", var5, 4096000);
}
int var6 = (int)(var3 >>> 32);
if (var2 + var6 + var5 * 4L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("ChargeTimes", (int)Math.min(var2 + var6 + var5 * 4L, 2147483647L), (int)var0.byteSize());
}
var2 += var6;
float[] var7 = new float[var5];
MemorySegment.copy(var0, PacketIO.PROTO_FLOAT, var2, var7, 0, var5);
class="kw">return var7;
}
class="kw">public class="kw">static boolean getSkipCooldownReset(MemorySegment var0) {
class="kw">return getSkipCooldownReset(var0, 0);
}
class="kw">public class="kw">static boolean getSkipCooldownReset(MemorySegment var0, int var1) {
class="kw">return (var0.get(PacketIO.PROTO_BYTE, var1 + 6) & 1) != 0;
}
class="kw">public class="kw">static boolean getInterruptRecharge(MemorySegment var0) {
class="kw">return getInterruptRecharge(var0, 0);
}
class="kw">public class="kw">static boolean getInterruptRecharge(MemorySegment var0, int var1) {
class="kw">return (var0.get(PacketIO.PROTO_BYTE, var1 + 6) & 2) != 0;
}
class="kw">public class="kw">static boolean hasCooldownId(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 hasChargeTimes(MemorySegment var0, int var1) {
byte var2 = var0.get(PacketIO.PROTO_BYTE, var1 + 0);
class="kw">return (var2 & 2) != 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 InteractionCooldown toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static InteractionCooldown toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static InteractionCooldown toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 15;
int var4 = 0;
String var5 = null;
if (hasCooldownId(var0, var1)) {
requireSlot(var0, var1 + 7, var4, "CooldownId");
int var6 = var3 + var4;
long var7 = VarInt.getWithLength(var0, var6);
var5 = PacketIO.readVarString("CooldownId", var0, var6, 0, 4096000, var7);
var4 += (int)var7 + (int)(var7 >>> 32);
} else {
requireSlot(var0, var1 + 7, -1, "CooldownId");
}
float[] var12 = null;
if (hasChargeTimes(var0, var1)) {
requireSlot(var0, var1 + 11, var4, "ChargeTimes");
int var13 = var3 + var4;
long var8 = VarInt.getWithLength(var0, var13);
if (var8 == -1L) {
throw ProtocolException.invalidVarInt("ChargeTimes");
}
int var10 = (int)var8;
if (var10 > 4096000) {
throw ProtocolException.arrayTooLong("ChargeTimes", var10, 4096000);
}
int var11 = (int)(var8 >>> 32);
if (var13 + var11 + var10 * 4L > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("ChargeTimes", (int)Math.min(var13 + var11 + var10 * 4L, 2147483647L), (int)var0.byteSize());
}
var13 += var11;
var12 = new float[var10];
MemorySegment.copy(var0, PacketIO.PROTO_FLOAT, var13, var12, 0, var10);
var4 = var13 + var10 * 4 - var3;
} else {
requireSlot(var0, var1 + 11, -1, "ChargeTimes");
}
InteractionCooldown var15 = new InteractionCooldown(
var5,
PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 1), "Cooldown"),
var0.get(PacketIO.PROTO_BOOL, var1 + 5),
var12,
(var0.get(PacketIO.PROTO_BYTE, var1 + 6) & 1) != 0,
(var0.get(PacketIO.PROTO_BYTE, var1 + 6) & 2) != 0
);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var15;
}
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
byte var3 = 0;
if (this.cooldownId != null) {
var3 = (byte)(var3 | 1);
}
if (this.chargeTimes != null) {
var3 = (byte)(var3 | 2);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
PacketIO.requireFinite(this.cooldown, "Cooldown");
var1.set(PacketIO.PROTO_FLOAT, var2 + 1, this.cooldown);
var1.set(PacketIO.PROTO_BOOL, var2 + 5, this.clickBypass);
byte var4 = 0;
if (this.skipCooldownReset) {
var4 = (byte)(var4 | 1);
}
if (this.interruptRecharge) {
var4 = (byte)(var4 | 2);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 6 + 0, var4);
int var5 = var2 + 15;
if (this.cooldownId != null) {
var1.set(PacketIO.PROTO_INT, var2 + 7, var5 - var2 - 15);
var5 += PacketIO.writeVarString(var1, var5, this.cooldownId, 4096000);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 7, -1);
}
if (this.chargeTimes != null) {
var1.set(PacketIO.PROTO_INT, var2 + 11, var5 - var2 - 15);
if (this.chargeTimes.length > 4096000) {
throw ProtocolException.arrayTooLong("ChargeTimes", this.chargeTimes.length, 4096000);
}
var5 += VarInt.set(var1, var5, this.chargeTimes.length);
MemorySegment.copy(this.chargeTimes, 0, var1, PacketIO.PROTO_FLOAT, var5, this.chargeTimes.length);
var5 += this.chargeTimes.length * 4;
} else {
var1.set(PacketIO.PROTO_INT, var2 + 11, -1);
}
class="kw">return var5 - var2;
}
class="kw">public int computeSize() {
int var1 = 15;
if (this.cooldownId != null) {
var1 += PacketIO.stringSize(this.cooldownId);
}
if (this.chargeTimes != null) {
var1 += VarInt.size(this.chargeTimes.length) + this.chargeTimes.length * 4;
}
class="kw">return var1;
}
class="kw">public InteractionCooldown clone() {
InteractionCooldown var1 = new InteractionCooldown();
var1.cooldownId = this.cooldownId;
var1.cooldown = this.cooldown;
var1.clickBypass = this.clickBypass;
var1.chargeTimes = this.chargeTimes != null ? Arrays.copyOf(this.chargeTimes, this.chargeTimes.length) : null;
var1.skipCooldownReset = this.skipCooldownReset;
var1.interruptRecharge = this.interruptRecharge;
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 InteractionCooldown var2)
? false
: Objects.equals(this.cooldownId, var2.cooldownId)
&& this.cooldown == var2.cooldown
&& this.clickBypass == var2.clickBypass
&& Arrays.equals(this.chargeTimes, var2.chargeTimes)
&& this.skipCooldownReset == var2.skipCooldownReset
&& this.interruptRecharge == var2.interruptRecharge;
}
}
@Override
class="kw">public int hashCode() {
int var1 = 1;
var1 = 31 * var1 + Objects.hashCode(this.cooldownId);
var1 = 31 * var1 + Float.hashCode(this.cooldown);
var1 = 31 * var1 + Boolean.hashCode(this.clickBypass);
var1 = 31 * var1 + Arrays.hashCode(this.chargeTimes);
var1 = 31 * var1 + Boolean.hashCode(this.skipCooldownReset);
class="kw">return 31 * var1 + Boolean.hashCode(this.interruptRecharge);
}
}