mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-10-31 23:59:37 +01:00
Add permission check to version and reload command
This commit is contained in:
parent
cae36a94bd
commit
b9f9166d6c
@ -4,6 +4,7 @@ import com.Acrobot.Breeze.Configuration.Configuration;
|
|||||||
import com.Acrobot.ChestShop.ChestShop;
|
import com.Acrobot.ChestShop.ChestShop;
|
||||||
import com.Acrobot.ChestShop.Configuration.Messages;
|
import com.Acrobot.ChestShop.Configuration.Messages;
|
||||||
import com.Acrobot.ChestShop.Configuration.Properties;
|
import com.Acrobot.ChestShop.Configuration.Properties;
|
||||||
|
import com.Acrobot.ChestShop.Permission;
|
||||||
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
import com.Acrobot.ChestShop.UUIDs.NameManager;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -15,6 +16,11 @@ import org.bukkit.command.CommandSender;
|
|||||||
*/
|
*/
|
||||||
public class Version implements CommandExecutor {
|
public class Version implements CommandExecutor {
|
||||||
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
|
||||||
|
if (!Permission.has(sender, Permission.ADMIN)) {
|
||||||
|
sender.sendMessage(Messages.prefix(Messages.ACCESS_DENIED));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length > 0 && args[0].equals("reload")) {
|
if (args.length > 0 && args[0].equals("reload")) {
|
||||||
Configuration.pairFileAndClass(ChestShop.loadFile("config.yml"), Properties.class);
|
Configuration.pairFileAndClass(ChestShop.loadFile("config.yml"), Properties.class);
|
||||||
Configuration.pairFileAndClass(ChestShop.loadFile("local.yml"), Messages.class);
|
Configuration.pairFileAndClass(ChestShop.loadFile("local.yml"), Messages.class);
|
||||||
|
Loading…
Reference in New Issue
Block a user