Class Bridge

java.lang.Object
de.themoep.connectorplugin.BridgeCommon<P,R>
de.themoep.connectorplugin.ProxyBridgeCommon<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
de.themoep.connectorplugin.bungee.Bridge
All Implemented Interfaces:
net.md_5.bungee.api.plugin.Listener

public class Bridge extends ProxyBridgeCommon<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer> implements net.md_5.bungee.api.plugin.Listener
  • Constructor Details

  • Method Details

    • teleport

      public CompletableFuture<Boolean> teleport(net.md_5.bungee.api.connection.ProxiedPlayer 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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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(net.md_5.bungee.api.connection.ProxiedPlayer 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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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(net.md_5.bungee.api.connection.ProxiedPlayer player, net.md_5.bungee.api.connection.ProxiedPlayer 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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      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(net.md_5.bungee.api.connection.ProxiedPlayer player)
      Get the location of a player on the server
      Specified by:
      getLocation in class BridgeCommon<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      player - The player to get the location for
      Returns:
      A future for when the location was queried
    • getServer

      public CompletableFuture<String> getServer(net.md_5.bungee.api.connection.ProxiedPlayer player)
      Get the server a player is connected to
      Specified by:
      getServer in class BridgeCommon<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      player - The player to get the server for
      Returns:
      A future for when the server was queried
    • runServerPlayerCommand

      public CompletableFuture<Boolean> runServerPlayerCommand(net.md_5.bungee.api.connection.ProxiedPlayer 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
    • registerServerCommand

      public void registerServerCommand(String server, BridgedCommand<?,net.md_5.bungee.api.CommandSender> command)
      Register a command on a server
      Parameters:
      server - The server
      command - The command to register
    • registerServerCommands

      protected void registerServerCommands(String server)
      Description copied from class: ProxyBridgeCommon
      Register all known commands on a server
      Specified by:
      registerServerCommands in class ProxyBridgeCommon<BungeeConnectorPlugin,net.md_5.bungee.api.connection.ProxiedPlayer>
      Parameters:
      server - The server
    • registerServerCommand

      public void registerServerCommand(BridgedCommand<? extends net.md_5.bungee.api.plugin.Plugin,net.md_5.bungee.api.CommandSender> command)
      Register a command on all servers
      Parameters:
      command - The command to register
    • onPlayerJoin

      public void onPlayerJoin(net.md_5.bungee.api.event.ServerConnectEvent event)
    • onPlayerJoined

      public void onPlayerJoined(net.md_5.bungee.api.event.ServerSwitchEvent event)
    • onPlayerQuit

      public void onPlayerQuit(net.md_5.bungee.api.event.PlayerDisconnectEvent event)