AssetEditorPopupNotification class

Пакет: com.hypixel.hytale.protocol.packets.asseteditor

Файл: com/hypixel/hytale/protocol/packets/asseteditor/AssetEditorPopupNotification.java

implements: Packet, ToClientPacket

Поля (15)

МодификаторыТипИмя
final int PACKET_ID
int var1
AssetEditorPopupNotification var1
long var2
byte var2
int var3
byte var3
var3
int var4
var4
int var4
ReadCursor var5
FormattedMessage var6
var6
AssetEditorPopupNotification var7

Методы (19)

МодификаторыВозвратСигнатура
public AssetEditorPopupNotification cloneAssetEditorPopupNotification clone()
abstract return getMessagereturn getMessage(var0, 0)
static AssetEditorPopupNotificationType getTypeAssetEditorPopupNotificationType getType(MemorySegment var0)
static AssetEditorPopupNotificationType getTypeAssetEditorPopupNotificationType getType(MemorySegment var0, int var1)
abstract return getTypereturn getType(var0, 0)
static boolean hasMessageboolean hasMessage(MemorySegment var0, int var1)
if if(var1 < 0)
if if(var2 != null)
if if(this.message != null)
if if(this.message != null)
if if(this.message != null)
if if(this == var1)
static void requireBoundsvoid requireBounds(MemorySegment var0, int var1)
abstract requireBounds requireBounds(var0, var1)
static AssetEditorPopupNotification toObjectAssetEditorPopupNotification toObject(MemorySegment var0)
static AssetEditorPopupNotification toObjectAssetEditorPopupNotification toObject(MemorySegment var0, int var1)
static AssetEditorPopupNotification toObjectAssetEditorPopupNotification 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.asseteditor;

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 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 AssetEditorPopupNotification class="kw">implements Packet, ToClientPacket {
   class="kw">public class="kw">static class="kw">final int PACKET_ID = 337;
   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 = 2;
   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 = 2;
   class="kw">public class="kw">static class="kw">final int MAX_SIZE = 1677721600;
   @Nonnull
   class="kw">public AssetEditorPopupNotificationType type = AssetEditorPopupNotificationType.Info;
   @Nullable
   class="kw">public FormattedMessage message;

   @Override
   class="kw">public int getId() {
      class="kw">return 337;
   }

   @Override
   class="kw">public NetworkChannel getChannel() {
      class="kw">return NetworkChannel.Default;
   }

   class="kw">public AssetEditorPopupNotification() {
   }

   class="kw">public AssetEditorPopupNotification(@Nonnull AssetEditorPopupNotificationType var1, @Nullable FormattedMessage var2) {
      this.type = var1;
      this.message = var2;
   }

   class="kw">public AssetEditorPopupNotification(@Nonnull AssetEditorPopupNotification var1) {
      this.type = var1.type;
      this.message = var1.message;
   }

   class="kw">public class="kw">static void requireBounds(MemorySegment var0, int var1) {
      if (var1 < 0) {
         throw ProtocolException.invalidOffset("AssetEditorPopupNotification", var1, (int)var0.byteSize());
      }

      long var2 = var1 + 2L;
      if (var2 > var0.byteSize()) {
         throw ProtocolException.bufferTooSmall("AssetEditorPopupNotification", (int)Math.min(var2, 2147483647L), (int)var0.byteSize());
      }
   }

   class="kw">public class="kw">static AssetEditorPopupNotificationType getType(MemorySegment var0) {
      class="kw">return getType(var0, 0);
   }

   class="kw">public class="kw">static AssetEditorPopupNotificationType getType(MemorySegment var0, int var1) {
      class="kw">return AssetEditorPopupNotificationType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 1));
   }

   @Nullable
   class="kw">public class="kw">static FormattedMessage getMessage(MemorySegment var0) {
      class="kw">return getMessage(var0, 0);
   }

   @Nullable
   class="kw">public class="kw">static FormattedMessage getMessage(MemorySegment var0, int var1) {
      class="kw">return hasMessage(var0, var1) ? FormattedMessage.toObject(var0, var1 + 2) : null;
   }

   class="kw">public class="kw">static boolean hasMessage(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 AssetEditorPopupNotification toObject(MemorySegment var0) {
      class="kw">return toObject(var0, 0, null);
   }

   class="kw">public class="kw">static AssetEditorPopupNotification toObject(MemorySegment var0, int var1) {
      class="kw">return toObject(var0, var1, null);
   }

   class="kw">public class="kw">static AssetEditorPopupNotification toObject(MemorySegment var0, int var1, @Nullable ReadCursor var2) {
      requireBounds(var0, var1);
      int var3 = var1 + 2;
      int var4 = 0;
      ReadCursor var5 = var2 != null ? var2 : new ReadCursor();
      FormattedMessage var6 = null;
      if (hasMessage(var0, var1)) {
         var6 = FormattedMessage.toObject(var0, var3 + var4, var5);
         var4 = var5.position - var3;
      }

      AssetEditorPopupNotification var7 = new AssetEditorPopupNotification(
         AssetEditorPopupNotificationType.fromValue(var0.get(PacketIO.PROTO_BYTE, var1 + 1)), var6
      );
      if (var2 != null) {
         var2.position = var3 + var4;
      }

      class="kw">return var7;
   }

   @Override
   class="kw">public int serialize(@Nonnull MemorySegment var1, int var2) {
      byte var3 = 0;
      if (this.message != null) {
         var3 = (byte)(var3 | 1);
      }

      var1.set(PacketIO.PROTO_BYTE, var2 + 0, var3);
      var1.set(PacketIO.PROTO_BYTE, var2 + 1, (byte)this.type.getValue());
      int var4 = var2 + 2;
      if (this.message != null) {
         var4 += this.message.serialize(var1, var4);
      }

      class="kw">return var4 - var2;
   }

   @Override
   class="kw">public int computeSize() {
      int var1 = 2;
      if (this.message != null) {
         var1 += this.message.computeSize();
      }

      class="kw">return var1;
   }

   class="kw">public AssetEditorPopupNotification clone() {
      AssetEditorPopupNotification var1 = new AssetEditorPopupNotification();
      var1.type = this.type;
      var1.message = this.message != null ? this.message.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 AssetEditorPopupNotification var2)
            ? false
            : Objects.equals(this.type, var2.type) && Objects.equals(this.message, var2.message);
      }
   }

   @Override
   class="kw">public int hashCode() {
      class="kw">return Objects.hash(this.type, this.message);
   }
}