reload command permission check

This commit is contained in:
Brian 2018-12-16 15:20:59 +02:00
parent 1d93f15491
commit e2593d3422
2 changed files with 13 additions and 0 deletions

View File

@ -3,11 +3,23 @@ package com.songoda.ultimatetimber.commands;
import com.songoda.ultimatetimber.UltimateTimber;
import com.songoda.ultimatetimber.treefall.CustomLoot;
import com.songoda.ultimatetimber.utils.Methods;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class ReloadCommand {
public static void reloadConfig(CommandSender commandSender) {
if(commandSender instanceof Player){
if(!commandSender.hasPermission("ut.reload")){
commandSender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&cYou don't have permission!"));
return;
}
}
UltimateTimber plugin = UltimateTimber.getInstance();
plugin.reloadConfig();
CustomLoot.initializeCustomItems();

View File

@ -32,6 +32,7 @@ public class TreeFallEvent implements Listener {
TreeChecker treeChecker = new TreeChecker();
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());
Bukkit.broadcastMessage(blocks.toString());
/*
Previous list will be null if no valid tree is found