Class SocketPlugin

java.lang.Object
xyz.gmitch215.socketmc.spigot.SocketPlugin
All Implemented Interfaces:
Serializable, Comparable<SocketPlugin>

public final class SocketPlugin extends Object implements Serializable, Comparable<SocketPlugin>
Wrapper class around a Plugin interface to be serialized and sent to the mod. Used for logging, settings, and other information purposes. In the eventuality that a Plugin interface is not available, use UNKNOWN.
See Also:
  • Field Details

    • UNKNOWN

      public static final SocketPlugin UNKNOWN
      Represents an unknown plugin.
  • Method Details

    • getMainClass

      @NotNull public @NotNull String getMainClass()
      Gets the main class of the plugin. Primary use of this is to identify the plugin across renames and other changes.
      Returns:
      Plugin Main Class
    • getPluginName

      @NotNull public @NotNull String getPluginName()
      Gets the name of the plugin.
      Returns:
      Plugin Name
    • getPluginVersion

      @NotNull public @NotNull String getPluginVersion()
      Gets the version of the plugin.
      Returns:
      Plugin Version
    • getPluginUrl

      @Nullable public @Nullable String getPluginUrl()
      Gets the URL of the plugin.
      Returns:
      Plugin Website
    • getJarFilePath

      @NotNull public @NotNull String getJarFilePath()
      Gets the file path of the plugin jar file.
      Returns:
      Plugin File Path
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toByteArray

      public byte[] toByteArray()
      Serializes this SocketPlugin to a byte array to be passed over the network.
      Returns:
      Byte Array Representation
    • fromByteArray

      @Nullable public static @Nullable SocketPlugin fromByteArray(byte[] plugin)
      Deserializes an SocketPlugin from a byte array received over the network.
      Parameters:
      plugin - Byte Array Representation
      Returns:
      Deserialized Instruction
    • compareTo

      public int compareTo(@NotNull @NotNull SocketPlugin o)
      Specified by:
      compareTo in interface Comparable<SocketPlugin>