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
-
Nested Class Summary
Nested classes/interfaces inherited from class de.themoep.connectorplugin.BridgeCommon
BridgeCommon.Action, BridgeCommon.BridgeMessage, BridgeCommon.PlayerInfo
-
Field Summary
Fields inherited from class de.themoep.connectorplugin.BridgeCommon
consumers, playerInfoMap, plugin, RANDOM, responses
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreatePlayerInfo
(net.md_5.bungee.api.connection.ProxiedPlayer player) Create a player info object for a playergetLocation
(net.md_5.bungee.api.connection.ProxiedPlayer player) Get the location of a player on the serverprotected net.md_5.bungee.api.connection.ProxiedPlayer
Get a player by namegetServer
(net.md_5.bungee.api.connection.ProxiedPlayer player) Get the server a player is connected tovoid
onPlayerJoin
(net.md_5.bungee.api.event.ServerConnectEvent event) void
onPlayerJoined
(net.md_5.bungee.api.event.ServerSwitchEvent event) void
onPlayerQuit
(net.md_5.bungee.api.event.PlayerDisconnectEvent event) void
registerServerCommand
(BridgedCommand<? extends net.md_5.bungee.api.plugin.Plugin, net.md_5.bungee.api.CommandSender> command) Register a command on all serversvoid
registerServerCommand
(String server, BridgedCommand<?, net.md_5.bungee.api.CommandSender> command) Register a command on a serverprotected void
registerServerCommands
(String server) Register all known commands on a serverrunServerPlayerCommand
(net.md_5.bungee.api.connection.ProxiedPlayer player, String command) Run a command for a player on the server they are connected to.teleport
(String playerName, LocationInfo location, Consumer<String>... consumer) Teleport a player to a certain location in the networkTeleport a player to a certain location in the networkTeleport a player to a certain other player in the networkteleport
(net.md_5.bungee.api.connection.ProxiedPlayer player, LocationInfo location, Consumer<String>... consumer) Teleport a player to a certain location in the networkteleport
(net.md_5.bungee.api.connection.ProxiedPlayer player, String serverName, String worldName, Consumer<String>... consumer) Teleport a player to a certain location in the networkteleport
(net.md_5.bungee.api.connection.ProxiedPlayer player, net.md_5.bungee.api.connection.ProxiedPlayer target, Consumer<String>... consumer) Teleport a player to a certain other player in the networkMethods inherited from class de.themoep.connectorplugin.ProxyBridgeCommon
onPlayerJoin, onPlayerLeave, runProxyConsoleCommand, sendResponseData
Methods inherited from class de.themoep.connectorplugin.BridgeCommon
addPlayerInfo, getLocation, getServer, handleResponse, isTeleporting, markTeleporting, registerHandler, registerMessageHandler, removePlayerInfo, runProxyConsoleCommand, runServerConsoleCommand, sendData, sendData, sendData, sendResponse, sendResponseMessage, unmarkTeleporting
-
Constructor Details
-
Bridge
-
-
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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
player
- The player to teleportlocation
- The location to teleport toconsumer
- 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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
playerName
- The name of the player to teleportlocation
- The location to teleport toconsumer
- 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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
player
- The player to teleportserverName
- The target serverworldName
- The target worldconsumer
- 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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
playerName
- The name of the player to teleportserverName
- The target serverworldName
- The target worldconsumer
- 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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
player
- The player to teleporttarget
- The target playerconsumer
- 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 classBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
playerName
- The name of the player to teleporttargetName
- The name of the target playerconsumer
- 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 classBridgeCommon<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
Get the server a player is connected to- Specified by:
getServer
in classBridgeCommon<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 forcommand
- 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 servercommand
- The command to register
-
registerServerCommands
Description copied from class:ProxyBridgeCommon
Register all known commands on a server- Specified by:
registerServerCommands
in classProxyBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
server
- The server
-
getPlayer
Description copied from class:ProxyBridgeCommon
Get a player by name- Specified by:
getPlayer
in classProxyBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
playerName
- The name of the player- Returns:
- The player
-
createPlayerInfo
public BridgeCommon.PlayerInfo createPlayerInfo(net.md_5.bungee.api.connection.ProxiedPlayer player) Description copied from class:ProxyBridgeCommon
Create a player info object for a player- Specified by:
createPlayerInfo
in classProxyBridgeCommon<BungeeConnectorPlugin,
net.md_5.bungee.api.connection.ProxiedPlayer> - Parameters:
player
- The player- Returns:
- The player info object
-
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)
-