SubServers-2/SubServers.Bungee/common/src/net/ME1312/SubServers/Bungee/BungeeAPI.java

138 lines
3.1 KiB
Java
Raw Normal View History

2020-11-14 04:41:56 +01:00
package net.ME1312.SubServers.Bungee;
import net.ME1312.Galaxi.Library.Util;
import net.ME1312.Galaxi.Library.Version.Version;
import net.ME1312.SubServers.Bungee.Library.Compatibility.RemotePlayer;
2020-11-16 21:34:59 +01:00
2020-11-14 04:41:56 +01:00
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.config.ServerInfo;
2020-11-14 04:41:56 +01:00
import java.io.File;
2020-11-16 21:34:59 +01:00
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
2020-11-14 04:41:56 +01:00
/**
* SubAPI BungeeCord Common Class
*/
public interface BungeeAPI {
/**
* Gets the SubAPI BungeeCord Common Methods
*
* @return SubAPI BungeeCord Common
*/
static BungeeAPI getInstance() {
return ((BungeeCommon) ProxyServer.getInstance()).api.get();
2020-11-14 04:41:56 +01:00
}
2021-06-14 06:42:06 +02:00
/**
* Gets the BungeeCommon Internals
*
* @deprecated Use BungeeAPI Methods when available
* @return BungeeCommon Internals
*/
@Deprecated
BungeeCommon getInternals();
2020-11-14 04:41:56 +01:00
/**
* Get the number of players on this network across all known proxies
*
* @return Remote Player Collection
*/
int getRemotePlayerCount();
/**
* Get players on this server across all known proxies
*
* @param server Server to search
* @return Remote Player Map
*/
Map<UUID, ? extends RemotePlayer> getRemotePlayers(ServerInfo server);
2020-11-14 04:41:56 +01:00
/**
* Get players on this network across all known proxies
*
* @return Remote Player Map
2020-11-14 04:41:56 +01:00
*/
Map<UUID, ? extends RemotePlayer> getRemotePlayers();
2020-11-14 04:41:56 +01:00
/**
* Get a player on this network by searching across all known proxies
*
* @param name Player name
* @return Remote Player
*/
RemotePlayer getRemotePlayer(String name);
2020-11-14 04:41:56 +01:00
/**
* Get a player on this network by searching across all known proxies
*
* @param id Player UUID
* @return Remote Player
*/
RemotePlayer getRemotePlayer(UUID id);
2020-11-14 04:41:56 +01:00
/**
* Gets the current SubServers Lang Channels
*
* @return SubServers Lang Channel list
*/
Collection<String> getLangChannels();
/**
* Gets values from the SubServers Lang
*
* @param channel Lang Channel
* @return Lang Value
*/
Map<String, String> getLang(String channel);
/**
* Gets a value from the SubServers Lang
*
* @param channel Lang Channel
* @param key Key
* @return Lang Values
*/
default String getLang(String channel, String key) {
Util.nullpo(channel, key);
2020-11-14 04:41:56 +01:00
return getLang(channel).get(key);
}
/**
* Gets the Runtime Directory
*
* @return Directory
*/
File getRuntimeDirectory();
2020-11-14 04:41:56 +01:00
/**
* Gets the SubServers Version
*
* @return SubServers Version
*/
Version getWrapperVersion();
/**
2021-02-13 06:04:20 +01:00
* Gets the SubServers Build Version
2020-11-14 04:41:56 +01:00
*
2021-02-13 06:04:20 +01:00
* @return SubServers Build Version (or null if unsigned)
2020-11-14 04:41:56 +01:00
*/
Version getWrapperBuild();
/**
* Gets the BungeeCord Version
*
* @return BungeeCord Version
*/
Version getProxyVersion();
/**
* Get an array of compatible Minecraft Versions
*
* @return Minecraft Versions
*/
Version[] getGameVersion();
}