Class Bridge

java.lang.Object
de.themoep.connectorplugin.BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
de.themoep.connectorplugin.bukkit.Bridge
All Implemented Interfaces:
org.bukkit.event.Listener

public class Bridge extends BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player> implements org.bukkit.event.Listener
  • Constructor Details

  • Method Details

    • onSpawnLocationEvent

      public void onSpawnLocationEvent(org.spigotmc.event.player.PlayerSpawnLocationEvent event)
    • onPlayerJoin

      public void onPlayerJoin(org.bukkit.event.player.PlayerJoinEvent event)
    • onPlayerQuit

      public void onPlayerQuit(org.bukkit.event.player.PlayerQuitEvent event)
    • adapt

      public org.bukkit.Location adapt(LocationInfo location)
    • adapt

      public LocationInfo adapt(org.bukkit.Location location)
    • sendResponseData

      protected void sendResponseData(String target, byte[] out)
      Specified by:
      sendResponseData in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
    • sendToServer

      public CompletableFuture<Boolean> sendToServer(String playerName, String serverName, Consumer<String>... consumer)
      Teleport a player to a certain server in the network
      Parameters:
      playerName - The name of the player to send
      serverName - The name of the server to send to
      consumer - Details about the sending
      Returns:
      A future about whether the player could be sent
    • teleport

      public CompletableFuture<Boolean> teleport(org.bukkit.entity.Player player, LocationInfo location, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain location in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      player - The player to teleport
      location - The location to teleport to
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • teleport

      public CompletableFuture<Boolean> teleport(String playerName, LocationInfo location, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain location in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      playerName - The name of the player to teleport
      location - The location to teleport to
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • teleport

      public CompletableFuture<Boolean> teleport(org.bukkit.entity.Player player, String serverName, String worldName, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain location in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      player - The player to teleport
      serverName - The target server
      worldName - The target world
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • teleport

      public CompletableFuture<Boolean> teleport(String playerName, String serverName, String worldName, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain location in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      playerName - The name of the player to teleport
      serverName - The target server
      worldName - The target world
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • teleport

      public CompletableFuture<Boolean> teleport(org.bukkit.entity.Player player, org.bukkit.entity.Player target, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain other player in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      player - The player to teleport
      target - The target player
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • teleport

      public CompletableFuture<Boolean> teleport(String playerName, String targetName, Consumer<String>... consumer)
      Description copied from class: BridgeCommon
      Teleport a player to a certain other player in the network
      Specified by:
      teleport in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      playerName - The name of the player to teleport
      targetName - The name of the target player
      consumer - Details about the teleport
      Returns:
      A future about whether the player could be teleported
    • getServer

      public CompletableFuture<String> getServer(org.bukkit.entity.Player player)
      Get the server a player is connected to
      Specified by:
      getServer in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      player - The player to get the server for
      Returns:
      A future for when the server was queried
    • getLocation

      public CompletableFuture<LocationInfo> getLocation(org.bukkit.entity.Player player)
      Get the location a player is connected to
      Specified by:
      getLocation in class BridgeCommon<BukkitConnectorPlugin,org.bukkit.entity.Player>
      Parameters:
      player - The player to get the location for
      Returns:
      A future for when the location was queried
    • runProxyPlayerCommand

      public CompletableFuture<Boolean> runProxyPlayerCommand(org.bukkit.entity.Player player, String command)
      Run a command for a player on the proxy they are connected to. The player needs to have access to that command!
      Parameters:
      player - The player to run the command for
      command - The command to run
      Returns:
      A future for whether the command was run successfully
    • runProxyConsoleCommand

      public CompletableFuture<Boolean> runProxyConsoleCommand(String command, Consumer<String>... consumer)
      Run a console command on the connected proxies
      Parameters:
      command - The command to run
      consumer - Optional Consumer (or multiple) for the messages triggered by the command
      Returns:
      A future for whether the command was run successfully