public abstract class CommandUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.geysermc.floodgate.api.FloodgateApi |
api |
protected LanguageManager |
manager |
| Modifier | Constructor and Description |
|---|---|
protected |
CommandUtil(LanguageManager manager,
org.geysermc.floodgate.api.FloodgateApi api) |
| Modifier and Type | Method and Description |
|---|---|
protected Object |
applyPlayerTypeFilter(Object player,
PlayerType filter,
Object fallback) |
protected abstract Collection<?> |
getOnlinePlayers() |
Collection<Object> |
getOnlinePlayersWithPermission(String permission)
Get all online players with the given permission.
|
@NonNull Collection<String> |
getOnlineUsernames(@NonNull PlayerType limitTo) |
abstract Object |
getPlayerByUsername(@NonNull String username) |
Object |
getPlayerByUsername(@NonNull String username,
PlayerType filter) |
abstract Object |
getPlayerByUuid(@NonNull UUID uuid) |
Object |
getPlayerByUuid(@NonNull UUID uuid,
PlayerType limitTo) |
@Nullable ProfileAudience |
getProfileAudience(@NonNull Object source,
boolean allowOffline)
Get a ProfileAudience from a source.
|
abstract @NonNull UserAudience |
getUserAudience(@NonNull Object source) |
protected abstract String |
getUsernameFromSource(@NonNull Object source) |
protected abstract UUID |
getUuidFromSource(@NonNull Object source) |
abstract boolean |
hasPermission(Object player,
String permission)
Checks if the given player has the given permission.
|
abstract void |
kickPlayer(Object player,
String message)
Kicks the given player using the given message as the kick reason.
|
boolean |
removePlayerFromWhitelist(String xuid,
String username)
Removes the given Bedrock player from the whitelist.
|
boolean |
removePlayerFromWhitelist(UUID uuid,
String username)
Removes the given Bedrock player from the whitelist.
|
abstract void |
sendMessage(Object target,
String message)
Sends a raw message to the specified target, no matter what platform Floodgate is running
on.
|
String |
translateMessage(String locale,
TranslatableMessage message,
Object... args) |
boolean |
whitelistPlayer(String xuid,
String username)
Whitelist the given Bedrock player.
|
boolean |
whitelistPlayer(UUID uuid,
String username)
Whitelist the given Bedrock player.
|
protected final LanguageManager manager
protected final org.geysermc.floodgate.api.FloodgateApi api
protected CommandUtil(LanguageManager manager, org.geysermc.floodgate.api.FloodgateApi api)
public abstract @NonNull UserAudience getUserAudience(@NonNull Object source)
public @Nullable ProfileAudience getProfileAudience(@NonNull Object source, boolean allowOffline)
source - source to create a ProfileAudience fromallowOffline - if offline players are allowedprotected abstract Collection<?> getOnlinePlayers()
public @NonNull Collection<String> getOnlineUsernames(@NonNull PlayerType limitTo)
public Object getPlayerByUuid(@NonNull UUID uuid, PlayerType limitTo)
public Object getPlayerByUsername(@NonNull String username, PlayerType filter)
protected Object applyPlayerTypeFilter(Object player, PlayerType filter, Object fallback)
public abstract boolean hasPermission(Object player, String permission)
player - the player to checkpermission - the permission to checkpublic Collection<Object> getOnlinePlayersWithPermission(String permission)
permission - the permission to checkpublic abstract void sendMessage(Object target, String message)
target - the player that should receive the messagemessage - the messagepublic abstract void kickPlayer(Object player, String message)
player - the player that should be kickedmessage - the command messagepublic String translateMessage(String locale, TranslatableMessage message, Object... args)
public boolean whitelistPlayer(String xuid, String username)
xuid - the xuid of the username to be whitelistedusername - the username to be whitelistedpublic boolean whitelistPlayer(UUID uuid, String username)
uuid - the UUID of the username to be whitelistedusername - the username to be whitelistedpublic boolean removePlayerFromWhitelist(String xuid, String username)
xuid - the xuid of the username to be removed from the whitelistusername - the username to be removed from the whitelistpublic boolean removePlayerFromWhitelist(UUID uuid, String username)
uuid - the UUID of the username to be removed from the whitelistusername - the username to be removed from the whitelist