Class HandshakeDataImpl

java.lang.Object
org.geysermc.floodgate.core.addon.data.HandshakeDataImpl
All Implemented Interfaces:
HandshakeData

public class HandshakeDataImpl extends Object implements HandshakeData
  • Constructor Details

  • Method Details

    • applyChanges

      public FloodgateConnection applyChanges(FloodgateConnection connection, FloodgateConfig config)
    • getCorrectUsername

      public String getCorrectUsername()
      Specified by:
      getCorrectUsername in interface HandshakeData
    • getCorrectUniqueId

      public UUID getCorrectUniqueId()
      Specified by:
      getCorrectUniqueId in interface HandshakeData
    • isFloodgatePlayer

      public boolean isFloodgatePlayer()
      Description copied from interface: HandshakeData
      Returns true if the given player is a Floodgate player, false otherwise.
      Specified by:
      isFloodgatePlayer in interface HandshakeData
    • getBedrockData

      public org.geysermc.floodgate.util.BedrockData getBedrockData()
      Description copied from interface: HandshakeData
      Returns the decrypted BedrockData sent by Geyser or null if the player isn't a Floodgate player.
      Specified by:
      getBedrockData in interface HandshakeData
    • getJavaUsername

      public String getJavaUsername()
      Specified by:
      getJavaUsername in interface HandshakeData
    • getJavaUniqueId

      public UUID getJavaUniqueId()
      Specified by:
      getJavaUniqueId in interface HandshakeData
    • getLinkedPlayer

      public org.geysermc.floodgate.util.LinkedPlayer getLinkedPlayer()
      Description copied from interface: HandshakeData
      Returns the linked account associated with the client or null if the player isn't linked or not a Floodgate player.
      Specified by:
      getLinkedPlayer in interface HandshakeData
    • getHostname

      public String getHostname()
      Description copied from interface: HandshakeData
      Returns the hostname used in the handshake packet. This is the hostname after Floodgate removed the data.
      Specified by:
      getHostname in interface HandshakeData
    • getIp

      public String getIp()
      Description copied from interface: HandshakeData
      Returns the IP address of the client. The initial value is BedrockData.getIp() when BedrockData isn't null, or null if BedrockData is null. This method will return the changed IP if it has been changed using HandshakeData.setIp(String)
      Specified by:
      getIp in interface HandshakeData
    • getDisconnectReason

      public String getDisconnectReason()
      Description copied from interface: HandshakeData
      Returns the reason to disconnect the current player.
      Specified by:
      getDisconnectReason in interface HandshakeData
    • setLinkedPlayer

      public void setLinkedPlayer(org.geysermc.floodgate.util.LinkedPlayer linkedPlayer)
      Description copied from interface: HandshakeData
      Set the LinkedPlayer. This will be ignored if the player isn't a Floodgate player
      Specified by:
      setLinkedPlayer in interface HandshakeData
      Parameters:
      linkedPlayer - the player to use as link
    • setHostname

      public void setHostname(String hostname)
      Description copied from interface: HandshakeData
      Set the hostname of the handshake packet. Changing it here will also change it in the handshake packet.
      Specified by:
      setHostname in interface HandshakeData
      Parameters:
      hostname - the new hostname
    • setIp

      public void setIp(String ip)
      Description copied from interface: HandshakeData
      Set the IP address of the connected client. Floodgate doesn't perform any checks if the provided data is valid (hence one of the reasons why this class has been made for advanced users), thank you for not abusing Floodgate's trust in you :)
      Specified by:
      setIp in interface HandshakeData
      Parameters:
      ip - the IP address of the client
    • setDisconnectReason

      public void setDisconnectReason(String disconnectReason)
      Description copied from interface: HandshakeData
      Set the reason to disconnect the current player.
      Specified by:
      setDisconnectReason in interface HandshakeData
      Parameters:
      disconnectReason - the reason to disconnect