Class AbstractScreen

java.lang.Object
xyz.gmitch215.socketmc.screen.AbstractScreen
All Implemented Interfaces:
Serializable, Narratable
Direct Known Subclasses:
CustomScreen, DefaultScreen

public abstract class AbstractScreen extends Object implements Narratable
Represents a screen that can be displayed to the user. This class is not legal for implementation!
See Also:
  • Constructor Details

    • AbstractScreen

      protected AbstractScreen()
      Constructs a new screen.
  • Method Details

    • getTitleJSON

      @NotNull public abstract @NotNull String getTitleJSON()
      Gets the title of this screen.
      Returns:
      Title in JSON Format
    • getNarrationMessageJSON

      public String getNarrationMessageJSON()
      Description copied from interface: Narratable
      Gets the JSON message that represents the narration of this element. By default, this is the title of the element.
      Specified by:
      getNarrationMessageJSON in interface Narratable
      Returns:
      the JSON message
    • toByteArray

      public final byte[] toByteArray()
      Serializes this screen to a byte array.
      Returns:
      Byte Array
    • fromByteArray

      @NotNull public static @NotNull AbstractScreen fromByteArray(byte[] bytes)
      Deserializes a screen from a byte array.
      Parameters:
      bytes - Byte Array
      Returns:
      Deserialized Screem