Class Bridge

java.lang.Object
de.themoep.connectorplugin.BridgeCommon<P,R>
de.themoep.connectorplugin.ProxyBridgeCommon<VelocityConnectorPlugin,com.velocitypowered.api.proxy.Player>
de.themoep.connectorplugin.velocity.Bridge

public class Bridge extends ProxyBridgeCommon<VelocityConnectorPlugin,com.velocitypowered.api.proxy.Player>
  • Constructor Details

  • Method Details

    • teleport

      public CompletableFuture<Boolean> teleport(com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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(com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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(com.velocitypowered.api.proxy.Player player, com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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<VelocityConnectorPlugin,com.velocitypowered.api.proxy.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
    • getLocation

      public CompletableFuture<LocationInfo> getLocation(com.velocitypowered.api.proxy.Player player)
      Get the location of a player on the server
      Specified by:
      getLocation in class BridgeCommon<VelocityConnectorPlugin,com.velocitypowered.api.proxy.Player>
      Parameters:
      player - The player to get the location for
      Returns:
      A future for when the location was queried
    • getServer

      public CompletableFuture<String> getServer(com.velocitypowered.api.proxy.Player player)
      Get the server a player is connected to
      Specified by:
      getServer in class BridgeCommon<VelocityConnectorPlugin,com.velocitypowered.api.proxy.Player>
      Parameters:
      player - The player to get the server for
      Returns:
      A future for when the server was queried
    • runServerPlayerCommand

      public CompletableFuture<Boolean> runServerPlayerCommand(com.velocitypowered.api.proxy.Player player, String command)
      Run a command for a player on the server 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
    • registerServerCommands

      protected void registerServerCommands(String server)
      Description copied from class: ProxyBridgeCommon
      Register all known commands on a server
      Specified by:
      registerServerCommands in class ProxyBridgeCommon<VelocityConnectorPlugin,com.velocitypowered.api.proxy.Player>
      Parameters:
      server - The server
    • registerServerCommand

      public void registerServerCommand(String server, BridgedCommand<?,com.velocitypowered.api.command.CommandSource> command)
      Register a command on a server
      Parameters:
      server - The server
      command - The command to register
    • registerServerCommand

      public void registerServerCommand(BridgedCommand<?,com.velocitypowered.api.command.CommandSource> command)
      Register a command on all servers
      Parameters:
      command - The command to register
    • onPlayerJoin

      public void onPlayerJoin(com.velocitypowered.api.event.player.ServerPreConnectEvent event)
    • onPlayerJoined

      public void onPlayerJoined(com.velocitypowered.api.event.player.ServerPostConnectEvent event)
    • onPlayerQuit

      public void onPlayerQuit(com.velocitypowered.api.event.connection.DisconnectEvent event)