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>
-
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
-
Method Summary
Modifier and TypeMethodDescriptioncreatePlayerInfo
(com.velocitypowered.api.proxy.Player player) Create a player info object for a playergetLocation
(com.velocitypowered.api.proxy.Player player) Get the location of a player on the serverprotected com.velocitypowered.api.proxy.Player
Get a player by namegetServer
(com.velocitypowered.api.proxy.Player player) Get the server a player is connected tovoid
onPlayerJoin
(com.velocitypowered.api.event.player.ServerPreConnectEvent event) void
onPlayerJoined
(com.velocitypowered.api.event.player.ServerPostConnectEvent event) void
onPlayerQuit
(com.velocitypowered.api.event.connection.DisconnectEvent event) void
registerServerCommand
(BridgedCommand<?, com.velocitypowered.api.command.CommandSource> command) Register a command on all serversvoid
registerServerCommand
(String server, BridgedCommand<?, com.velocitypowered.api.command.CommandSource> command) Register a command on a serverprotected void
registerServerCommands
(String server) Register all known commands on a serverrunServerPlayerCommand
(com.velocitypowered.api.proxy.Player player, String command) Run a command for a player on the server they are connected to.teleport
(com.velocitypowered.api.proxy.Player player, com.velocitypowered.api.proxy.Player target, Consumer<String>... consumer) Teleport a player to a certain other player in the networkteleport
(com.velocitypowered.api.proxy.Player player, LocationInfo location, Consumer<String>... consumer) Teleport a player to a certain location in the networkteleport
(com.velocitypowered.api.proxy.Player player, String serverName, String worldName, Consumer<String>... consumer) Teleport a player to a certain location in the networkteleport
(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 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(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 classBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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(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 classBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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(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 classBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - 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
Get the location of a player on the server- Specified by:
getLocation
in classBridgeCommon<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
Get the server a player is connected to- Specified by:
getServer
in classBridgeCommon<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 forcommand
- The command to run- Returns:
- A future for whether the command was run successfully
-
registerServerCommands
Description copied from class:ProxyBridgeCommon
Register all known commands on a server- Specified by:
registerServerCommands
in classProxyBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - Parameters:
server
- The server
-
getPlayer
Description copied from class:ProxyBridgeCommon
Get a player by name- Specified by:
getPlayer
in classProxyBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - Parameters:
playerName
- The name of the player- Returns:
- The player
-
createPlayerInfo
Description copied from class:ProxyBridgeCommon
Create a player info object for a player- Specified by:
createPlayerInfo
in classProxyBridgeCommon<VelocityConnectorPlugin,
com.velocitypowered.api.proxy.Player> - Parameters:
player
- The player- Returns:
- The player info object
-
registerServerCommand
public void registerServerCommand(String server, BridgedCommand<?, com.velocitypowered.api.command.CommandSource> command) Register a command on a server- Parameters:
server
- The servercommand
- 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)
-