mirror of
https://github.com/kaboomserver/extras.git
synced 2025-02-11 20:00:43 +00:00
Mark /spawn as unsupported on Folia servers
This commit is contained in:
parent
95a2c2a7a1
commit
21b579e37a
1 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,8 @@ import org.bukkit.command.CommandExecutor;
|
|||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import pw.kaboom.extras.Main;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
|
@ -19,6 +21,14 @@ public final class CommandSpawn implements CommandExecutor {
|
|||
final @Nonnull Command command,
|
||||
final @Nonnull String label,
|
||||
final String[] args) {
|
||||
final Main plugin = JavaPlugin.getPlugin(Main.class);
|
||||
|
||||
if (plugin.isFolia()) {
|
||||
sender.sendMessage(Component
|
||||
.text("Command cannot be ran on Folia servers!"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (sender instanceof ConsoleCommandSender) {
|
||||
sender.sendMessage(Component
|
||||
.text("Command has to be run by a player"));
|
||||
|
|
Loading…
Reference in a new issue