Class BungeeHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
To send bungee messages, it is required that a player is online and that stargate knows the server name as defined In the velocity / bungee config.static String
generateJsonMessage
(Portal portal, StargateProtocolRequestType requestType) static String
generateLegacyTeleportMessage
(String player, Portal portal) static String
generateRenameNetworkMessage
(String newId, String oldId) Get json message for changing the id of a networkstatic String
generateRenamePortalMessage
(String newName, String oldName, Network network) static String
generateTeleportJsonMessage
(String player, Portal portal) static @Nullable Network
getLegacyBungeeNetwork
(RegistryAPI registry, NetworkManager networkManager, String bungeeNetwork) Gets the legacy bungee networkstatic void
getServerId
(String dataFolder, String internalFolder) Gets the server's unique ID
-
Method Details
-
getServerId
Gets the server's unique IDIf the server this plugin runs on is missing an id, a new unique id will be generated.
- Parameters:
dataFolder
-The folder containing plugin data
internalFolder
-The folder containing internal hidden files
-
getLegacyBungeeNetwork
@Nullable public static @Nullable Network getLegacyBungeeNetwork(RegistryAPI registry, NetworkManager networkManager, String bungeeNetwork) throws UnimplementedFlagException Gets the legacy bungee networkIf the network doesn't already exist, it will be created
- Parameters:
registry
-The registry to use
bungeeNetwork
-The name of the legacy bungee network
- Returns:
The legacy bungee network, or null if unobtainable
- Throws:
UnimplementedFlagException
-If an unimplemented network type was used in creation (should not trigger)
-
generateJsonMessage
- Parameters:
portal
-The portal which was created or destroyed
requestType
-Whether the portal was created or destroyed
- Returns:
A json string message
-
generateRenameNetworkMessage
Get json message for changing the id of a network- Parameters:
newId
-The id to change to
oldId
-Previous id of the network
- Returns:
A json string with a rename network message
-
generateRenamePortalMessage
- Parameters:
newName
-The new portal name to change to
oldName
-The previous portal name
network
-The network of the portal
- Returns:
A json string with a rename portal message
-
generateTeleportJsonMessage
- Parameters:
player
-The player to teleport
portal
-The portal to teleport to (in the other server)
- Returns:
A json string with a teleport player message
-
generateLegacyTeleportMessage
- Parameters:
player
-The player to teleport
portal
-The portal to teleport
- Returns:
A legacy format (csv-ish) with teleport message
-
canSendBungeeMessages
public static boolean canSendBungeeMessages()To send bungee messages, it is required that a player is online and that stargate knows the server name as defined In the velocity / bungee config.- Returns:
True if the server can send bungee messages
-