mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2024-11-22 08:54:59 +00:00
Use command API properly
This commit is contained in:
parent
1ca7b9edc7
commit
58bcc1c2d6
@ -11,7 +11,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
@Info(name = "commandspy", description = "Spy on commands executed by players.", usage = "/commandspy")
|
@Info(name = "commandspy", description = "Spy on commands executed by players.", usage = "/commandspy")
|
||||||
@Permissive(perm = "datura.commandspy")
|
@Permissive(perm = "datura.commandspy", onlyPlayers = true)
|
||||||
public class CommandSpyCommand extends Commander
|
public class CommandSpyCommand extends Commander
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -30,18 +30,12 @@ public class CommandSpyCommand extends Commander
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Base
|
@Base
|
||||||
public void commandSpy(final CommandSender sender)
|
public void commandSpy(final Player sender)
|
||||||
{
|
{
|
||||||
if (!(sender instanceof Player))
|
|
||||||
{
|
|
||||||
sender.sendPlainMessage("You have to be a player to perform this command.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final var commandSpy = ((Datura) getPlugin()).
|
final var commandSpy = ((Datura) getPlugin()).
|
||||||
getCommandSpy();
|
getCommandSpy();
|
||||||
|
|
||||||
final var uuid = ((Player) sender).
|
final var uuid = sender.
|
||||||
getUniqueId();
|
getUniqueId();
|
||||||
|
|
||||||
if (commandSpy.isSpying(uuid))
|
if (commandSpy.isSpying(uuid))
|
||||||
|
Loading…
Reference in New Issue
Block a user