mirror of
https://github.com/xSquishyLiam/mc-GeyserModelEngine-plugin.git
synced 2025-12-20 07:19:20 +00:00
Add a reload command
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package re.imc.geysermodelengine.commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import re.imc.geysermodelengine.GeyserModelEngine;
|
||||
|
||||
public class ReloadCommand implements CommandExecutor {
|
||||
|
||||
private final GeyserModelEngine plugin;
|
||||
|
||||
public ReloadCommand(GeyserModelEngine plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (sender instanceof Player && !sender.hasPermission("geysermodelengine.reload")) {
|
||||
sender.sendMessage("§cYou don't have permission to use this command.");
|
||||
return true;
|
||||
}
|
||||
|
||||
plugin.reloadConfig();
|
||||
plugin.onEnable();
|
||||
|
||||
sender.sendMessage("§aGeyserModelEngine configuration reloaded!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user