Class SpigotCommandSender
java.lang.Object
org.geysermc.geyser.platform.spigot.command.SpigotCommandSender
- All Implemented Interfaces:
CommandSender
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the locale of the command sender.boolean
hasPermission(String permission)
Checks if the CommandSender has a permissionboolean
name()
void
sendMessage(String message)
static void
setUseLegacyLocaleMethod(boolean useLegacyMethod)
Set if we are on pre-1.12, and thereforeplayer.getLocale()
doesn't exist and we have to getplayer.spigot().getLocale()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.geysermc.geyser.command.CommandSender
sendMessage
-
Constructor Details
-
SpigotCommandSender
public SpigotCommandSender(org.bukkit.command.CommandSender handle)
-
-
Method Details
-
name
- Specified by:
name
in interfaceCommandSender
-
sendMessage
- Specified by:
sendMessage
in interfaceCommandSender
-
isConsole
public boolean isConsole()- Specified by:
isConsole
in interfaceCommandSender
- Returns:
- true if the specified sender is from the console.
-
getLocale
Description copied from interface:CommandSender
Returns the locale of the command sender. Defaults to the default locale atGeyserLocale.getDefaultLocale()
.- Specified by:
getLocale
in interfaceCommandSender
- Returns:
- the locale of the command sender.
-
hasPermission
Description copied from interface:CommandSender
Checks if the CommandSender has a permission- Specified by:
hasPermission
in interfaceCommandSender
- Parameters:
permission
- The permission node to check- Returns:
- true if the CommandSender has the requested permission, false if not
-
setUseLegacyLocaleMethod
public static void setUseLegacyLocaleMethod(boolean useLegacyMethod)Set if we are on pre-1.12, and thereforeplayer.getLocale()
doesn't exist and we have to getplayer.spigot().getLocale()
.- Parameters:
useLegacyMethod
- if we are running pre-1.12 and therefore need to use reflection to get the player locale
-