Record Class VanishBridgeMessage
java.lang.Object
java.lang.Record
dev.plex.network.VanishBridgeMessage
- Record Components:
action- requested action or reported stateplayerId- player UUIDsilent- whether the action must not send a join or leave message
public record VanishBridgeMessage(VanishBridgeMessage.Action action, UUID playerId, boolean silent)
extends Record
A vanish message sent between Plex servers and proxies.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumActions supported by the vanish message protocol. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVanishBridgeMessage(VanishBridgeMessage.Action action, UUID playerId, boolean silent) Creates and validates a vanish message. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.static VanishBridgeMessagedecode(byte[] data) Decodes a message from the plugin message channel.byte[]encode()Encodes this message for the plugin message channel.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static VanishBridgeMessageCreates a request to hide a player.playerId()Returns the value of theplayerIdrecord component.static VanishBridgeMessageCreates a request for the player's current vanish state.static VanishBridgeMessageCreates a request to show a player.booleansilent()Returns the value of thesilentrecord component.static VanishBridgeMessageCreates a message that reports the player's vanish state.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CHANNEL
-
-
Constructor Details
-
VanishBridgeMessage
Creates and validates a vanish message.
-
-
Method Details
-
query
Creates a request for the player's current vanish state.- Parameters:
playerId- player UUID- Returns:
- query message
-
state
Creates a message that reports the player's vanish state.- Parameters:
playerId- player UUIDvanished- whether the player is vanished- Returns:
- state message
-
hide
Creates a request to hide a player.- Parameters:
playerId- player UUIDsilent- whether to hide the player without a leave message- Returns:
- hide message
-
show
Creates a request to show a player.- Parameters:
playerId- player UUIDsilent- whether to show the player without a join message- Returns:
- show message
-
encode
public byte[] encode()Encodes this message for the plugin message channel.- Returns:
- encoded message
-
decode
Decodes a message from the plugin message channel.- Parameters:
data- encoded message- Returns:
- decoded message
- Throws:
IOException- if the message is invalid or uses an unsupported version
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
action
-
playerId
-
silent
-