ShowEventTitle class
Пакет: com.hypixel.hytale.protocol.packets.interface_
Файл: com/hypixel/hytale/protocol/packets/interface_/ShowEventTitle.java
implements: Packet, ToClientPacket
Поля (28)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
int |
PACKET_ID |
|
int |
var1 |
|
ShowEventTitle |
var1 |
|
FormattedMessage |
var10 |
|
|
var10 |
|
FormattedMessage |
var11 |
|
|
var11 |
|
long |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
byte |
var2 |
|
int |
var3 |
|
byte |
var3 |
|
|
var3 |
|
|
var3 |
|
|
var3 |
|
int |
var4 |
|
int |
var4 |
|
|
var4 |
|
|
var4 |
|
int |
var4 |
|
int |
var5 |
|
ReadCursor |
var5 |
|
String |
var6 |
|
|
var6 |
|
int |
var7 |
|
long |
var8 |
|
ShowEventTitle |
var9 |
Методы (47)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
ShowEventTitle |
cloneShowEventTitle clone() |
static |
float |
getDurationfloat getDuration(MemorySegment var0) |
static |
float |
getDurationfloat getDuration(MemorySegment var0, int var1) |
abstract |
return |
getDurationreturn getDuration(var0, 0) |
static |
float |
getFadeInDurationfloat getFadeInDuration(MemorySegment var0) |
static |
float |
getFadeInDurationfloat getFadeInDuration(MemorySegment var0, int var1) |
abstract |
return |
getFadeInDurationreturn getFadeInDuration(var0, 0) |
static |
float |
getFadeOutDurationfloat getFadeOutDuration(MemorySegment var0) |
static |
float |
getFadeOutDurationfloat getFadeOutDuration(MemorySegment var0, int var1) |
abstract |
return |
getFadeOutDurationreturn getFadeOutDuration(var0, 0) |
abstract |
return |
getIconreturn getIcon(var0, 0) |
static |
boolean |
getIsMajorboolean getIsMajor(MemorySegment var0) |
static |
boolean |
getIsMajorboolean getIsMajor(MemorySegment var0, int var1) |
abstract |
return |
getIsMajorreturn getIsMajor(var0, 0) |
abstract |
return |
getPrimaryTitlereturn getPrimaryTitle(var0, 0) |
abstract |
return |
getSecondaryTitlereturn getSecondaryTitle(var0, 0) |
static |
int |
getValidatedOffsetint getValidatedOffset(MemorySegment var0, int var1, int var2, int var3, String var4) |
static |
boolean |
hasIconboolean hasIcon(MemorySegment var0, int var1) |
static |
boolean |
hasPrimaryTitleboolean hasPrimaryTitle(MemorySegment var0, int var1) |
static |
boolean |
hasSecondaryTitleboolean hasSecondaryTitle(MemorySegment var0, int var1) |
|
|
if if(var1 < 0) |
|
|
if if(var4 != var2) |
|
|
if if(var2 != null) |
|
|
if if(this.icon != null) |
|
|
if if(this.primaryTitle != null) |
|
|
if if(this.secondaryTitle != null) |
|
|
if if(this.icon != null) |
|
|
if if(this.primaryTitle != null) |
|
|
if if(this.secondaryTitle != null) |
|
|
if if(this.icon != null) |
|
|
if if(this.primaryTitle != null) |
|
|
if if(this.secondaryTitle != 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 + 14, var4, "Icon") |
abstract |
|
requireSlot requireSlot(var0, var1 + 14, -1, "Icon") |
abstract |
|
requireSlot requireSlot(var0, var1 + 18, var4, "PrimaryTitle") |
abstract |
|
requireSlot requireSlot(var0, var1 + 18, -1, "PrimaryTitle") |
abstract |
|
requireSlot requireSlot(var0, var1 + 22, var4, "SecondaryTitle") |
abstract |
|
requireSlot requireSlot(var0, var1 + 22, -1, "SecondaryTitle") |
static |
ShowEventTitle |
toObjectShowEventTitle toObject(MemorySegment var0) |
static |
ShowEventTitle |
toObjectShowEventTitle toObject(MemorySegment var0, int var1) |
static |
ShowEventTitle |
toObjectShowEventTitle 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.interface_;
class="kw">import com.hypixel.hytale.protocol.FormattedMessage;
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.Objects;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class ShowEventTitle class="kw">implements Packet, ToClientPacket {
class="kw">public class="kw">static class="kw">final int PACKET_ID = 214;
class="kw">public class="kw">static class="kw">final boolean IS_COMPRESSED = false;
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 = 14;
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 = 26;
class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
class="kw">public float fadeInDuration;
class="kw">public float fadeOutDuration;
class="kw">public float duration;
@Nullable
class="kw">public String icon;
class="kw">public boolean isMajor;
@Nullable
class="kw">public FormattedMessage primaryTitle;
@Nullable
class="kw">public FormattedMessage secondaryTitle;
@Override
class="kw">public int getId() {
class="kw">return 214;
}
@Override
class="kw">public NetworkChannel getChannel() {
class="kw">return NetworkChannel.Default;
}
class="kw">public ShowEventTitle() {
}
class="kw">public ShowEventTitle(
float var1, float var2, float var3, @Nullable String var4, boolean var5, @Nullable FormattedMessage var6, @Nullable FormattedMessage var7
) {
this.fadeInDuration = var1;
this.fadeOutDuration = var2;
this.duration = var3;
this.icon = var4;
this.isMajor = var5;
this.primaryTitle = var6;
this.secondaryTitle = var7;
}
class="kw">public ShowEventTitle(@Nonnull ShowEventTitle var1) {
this.fadeInDuration = var1.fadeInDuration;
this.fadeOutDuration = var1.fadeOutDuration;
this.duration = var1.duration;
this.icon = var1.icon;
this.isMajor = var1.isMajor;
this.primaryTitle = var1.primaryTitle;
this.secondaryTitle = var1.secondaryTitle;
}
class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
if (var1 < 0) {
throw ProtocolException.invalidOffset("ShowEventTitle", var1, (int)var0.byteSize());
}
long var2 = var1 + 26L;
if (var2 > var0.byteSize()) {
throw ProtocolException.bufferTooSmall("ShowEventTitle", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
}
}
class="kw">public class="kw">static float getFadeInDuration(MemorySegment var0) {
class="kw">return getFadeInDuration(var0, 0);
}
class="kw">public class="kw">static float getFadeInDuration(MemorySegment var0, int var1) {
class="kw">return PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 1), "FadeInDuration");
}
class="kw">public class="kw">static float getFadeOutDuration(MemorySegment var0) {
class="kw">return getFadeOutDuration(var0, 0);
}
class="kw">public class="kw">static float getFadeOutDuration(MemorySegment var0, int var1) {
class="kw">return PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 5), "FadeOutDuration");
}
class="kw">public class="kw">static float getDuration(MemorySegment var0) {
class="kw">return getDuration(var0, 0);
}
class="kw">public class="kw">static float getDuration(MemorySegment var0, int var1) {
class="kw">return PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 9), "Duration");
}
@Nullable
class="kw">public class="kw">static String getIcon(MemorySegment var0) {
class="kw">return getIcon(var0, 0);
}
@Nullable
class="kw">public class="kw">static String getIcon(MemorySegment var0, int var1) {
class="kw">return hasIcon(var0, var1) ? PacketIO.readVarString("Icon", var0, var1 + getValidatedOffset(var0, var1, 14, 26, "Icon"), 4096000) : null;
}
class="kw">public class="kw">static boolean getIsMajor(MemorySegment var0) {
class="kw">return getIsMajor(var0, 0);
}
class="kw">public class="kw">static boolean getIsMajor(MemorySegment var0, int var1) {
class="kw">return var0.get(PacketIO.PROTO_BOOL, var1 + 13);
}
@Nullable
class="kw">public class="kw">static FormattedMessage getPrimaryTitle(MemorySegment var0) {
class="kw">return getPrimaryTitle(var0, 0);
}
@Nullable
class="kw">public class="kw">static FormattedMessage getPrimaryTitle(MemorySegment var0, int var1) {
class="kw">return hasPrimaryTitle(var0, var1) ? FormattedMessage.toObject(var0, var1 + getValidatedOffset(var0, var1, 18, 26, "PrimaryTitle")) : null;
}
@Nullable
class="kw">public class="kw">static FormattedMessage getSecondaryTitle(MemorySegment var0) {
class="kw">return getSecondaryTitle(var0, 0);
}
@Nullable
class="kw">public class="kw">static FormattedMessage getSecondaryTitle(MemorySegment var0, int var1) {
class="kw">return hasSecondaryTitle(var0, var1) ? FormattedMessage.toObject(var0, var1 + getValidatedOffset(var0, var1, 22, 26, "SecondaryTitle")) : null;
}
class="kw">public class="kw">static boolean hasIcon(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 hasPrimaryTitle(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 hasSecondaryTitle(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 ShowEventTitle toObject(MemorySegment var0) {
class="kw">return toObject(var0, 0, null);
}
class="kw">public class="kw">static ShowEventTitle toObject(MemorySegment var0, int var1) {
class="kw">return toObject(var0, var1, null);
}
class="kw">public class="kw">static ShowEventTitle toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
requireBounds(var0, var1);
int var3 = var1 + 26;
int var4 = 0;
ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
String var6 = null;
if (hasIcon(var0, var1)) {
requireSlot(var0, var1 + 14, var4, "Icon");
int var7 = var3 + var4;
long var8 = VarInt.getWithLength(var0, var7);
var6 = PacketIO.readVarString("Icon", var0, var7, 0, 4096000, var8);
var4 += (int)var8 + (int)(var8 >>> 32);
} else {
requireSlot(var0, var1 + 14, -1, "Icon");
}
FormattedMessage var10 = null;
if (hasPrimaryTitle(var0, var1)) {
requireSlot(var0, var1 + 18, var4, "PrimaryTitle");
var10 = FormattedMessage.toObject(var0, var3 + var4, var5);
var4 = var5.position - var3;
} else {
requireSlot(var0, var1 + 18, -1, "PrimaryTitle");
}
FormattedMessage var11 = null;
if (hasSecondaryTitle(var0, var1)) {
requireSlot(var0, var1 + 22, var4, "SecondaryTitle");
var11 = FormattedMessage.toObject(var0, var3 + var4, var5);
var4 = var5.position - var3;
} else {
requireSlot(var0, var1 + 22, -1, "SecondaryTitle");
}
ShowEventTitle var9 = new ShowEventTitle(
PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 1), "FadeInDuration"),
PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 5), "FadeOutDuration"),
PacketIO.requireFinite(var0.get(PacketIO.PROTO_FLOAT, var1 + 9), "Duration"),
var6,
var0.get(PacketIO.PROTO_BOOL, var1 + 13),
var10,
var11
);
if (var2 != null) {
var2.position = var3 + var4;
}
class="kw">return var9;
}
@Override
class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
byte var3 = 0;
if (this.icon != null) {
var3 = (byte)(var3 | 1);
}
if (this.primaryTitle != null) {
var3 = (byte)(var3 | 2);
}
if (this.secondaryTitle != null) {
var3 = (byte)(var3 | 4);
}
var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
PacketIO.requireFinite(this.fadeInDuration, "FadeInDuration");
var1.set(PacketIO.PROTO_FLOAT, var2 + 1, this.fadeInDuration);
PacketIO.requireFinite(this.fadeOutDuration, "FadeOutDuration");
var1.set(PacketIO.PROTO_FLOAT, var2 + 5, this.fadeOutDuration);
PacketIO.requireFinite(this.duration, "Duration");
var1.set(PacketIO.PROTO_FLOAT, var2 + 9, this.duration);
var1.set(PacketIO.PROTO_BOOL, var2 + 13, this.isMajor);
int var4 = var2 + 26;
if (this.icon != null) {
var1.set(PacketIO.PROTO_INT, var2 + 14, var4 - var2 - 26);
var4 += PacketIO.writeVarString(var1, var4, this.icon, 4096000);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 14, -1);
}
if (this.primaryTitle != null) {
var1.set(PacketIO.PROTO_INT, var2 + 18, var4 - var2 - 26);
var4 += this.primaryTitle.serialize(var1, var4);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 18, -1);
}
if (this.secondaryTitle != null) {
var1.set(PacketIO.PROTO_INT, var2 + 22, var4 - var2 - 26);
var4 += this.secondaryTitle.serialize(var1, var4);
} else {
var1.set(PacketIO.PROTO_INT, var2 + 22, -1);
}
class="kw">return var4 - var2;
}
@Override
class="kw">public int computeSize() {
int var1 = 26;
if (this.icon != null) {
var1 += PacketIO.stringSize(this.icon);
}
if (this.primaryTitle != null) {
var1 += this.primaryTitle.computeSize();
}
if (this.secondaryTitle != null) {
var1 += this.secondaryTitle.computeSize();
}
class="kw">return var1;
}
class="kw">public ShowEventTitle clone() {
ShowEventTitle var1 = new ShowEventTitle();
var1.fadeInDuration = this.fadeInDuration;
var1.fadeOutDuration = this.fadeOutDuration;
var1.duration = this.duration;
var1.icon = this.icon;
var1.isMajor = this.isMajor;
var1.primaryTitle = this.primaryTitle != null ? this.primaryTitle.clone() : null;
var1.secondaryTitle = this.secondaryTitle != null ? this.secondaryTitle.clone() : null;
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 ShowEventTitle var2)
? false
: this.fadeInDuration == var2.fadeInDuration
&& this.fadeOutDuration == var2.fadeOutDuration
&& this.duration == var2.duration
&& Objects.equals(this.icon, var2.icon)
&& this.isMajor == var2.isMajor
&& Objects.equals(this.primaryTitle, var2.primaryTitle)
&& Objects.equals(this.secondaryTitle, var2.secondaryTitle);
}
}
@Override
class="kw">public int hashCode() {
class="kw">return Objects.hash(this.fadeInDuration, this.fadeOutDuration, this.duration, this.icon, this.isMajor, this.primaryTitle, this.secondaryTitle);
}
}