Package xyz.gmitch215.socketmc.spigot
Class SocketPlugin
java.lang.Object
xyz.gmitch215.socketmc.spigot.SocketPlugin
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static @Nullable SocketPlugin
fromByteArray
(byte[] plugin) Deserializes an SocketPlugin from a byte array received over the network.Gets the file path of the plugin jar file.Gets the main class of the plugin.Gets the name of the plugin.Gets the URL of the plugin.Gets the version of the plugin.int
hashCode()
byte[]
Serializes this SocketPlugin to a byte array to be passed over the network.
-
Field Details
-
UNKNOWN
Represents an unknown plugin.
-
-
Method Details
-
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
Gets the name of the plugin.- Returns:
- Plugin Name
-
getPluginVersion
Gets the version of the plugin.- Returns:
- Plugin Version
-
getPluginUrl
Gets the URL of the plugin.- Returns:
- Plugin Website
-
getJarFilePath
Gets the file path of the plugin jar file.- Returns:
- Plugin File Path
-
equals
-
hashCode
public int hashCode() -
toByteArray
public byte[] toByteArray()Serializes this SocketPlugin to a byte array to be passed over the network.- Returns:
- Byte Array Representation
-
fromByteArray
Deserializes an SocketPlugin from a byte array received over the network.- Parameters:
plugin
- Byte Array Representation- Returns:
- Deserialized Instruction
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SocketPlugin>
-