45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package dev.azurite.spigot.command;
|
|
|
|
import dev.azurite.spigot.Azurite;
|
|
import dev.azurite.spigot.configs.LanguageConfig;
|
|
import dev.azurite.spigot.framework.commands.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import java.util.Arrays;
|
|
|
|
/**
|
|
* Copyright (c) 2025. Keano
|
|
* Use or redistribution of source or file is
|
|
* only permitted if given explicit permission.
|
|
*/
|
|
public class NoTrackCommand extends Command {
|
|
|
|
public NoTrackCommand() {
|
|
super("notrack");
|
|
this.setPermission("azuritespigot.notrack");
|
|
this.setAliases(Arrays.asList("hiderange", "hideplayers"));
|
|
}
|
|
|
|
@Override
|
|
public void execute(CommandSender sender, String[] args) {
|
|
if (args.length == 0) {
|
|
sendMessage(sender, LanguageConfig.noTrackUsage.getValue());
|
|
return;
|
|
}
|
|
|
|
Integer amount = getInt(args[0]);
|
|
|
|
if (amount == null) {
|
|
sendMessage(sender, LanguageConfig.notValidType.getValue()
|
|
.replace("%value%", args[0])
|
|
.replace("%type%", Integer.class.getSimpleName())
|
|
);
|
|
return;
|
|
}
|
|
|
|
Azurite.getInstance().setNoTrackRange(amount);
|
|
sendMessage(sender, LanguageConfig.noTrackSet.getValue()
|
|
.replace("%range%", String.valueOf(amount))
|
|
);
|
|
}
|
|
} |