mirror of
https://github.com/songoda/UltimateTimber.git
synced 2024-11-05 01:59:43 +01:00
reload command permission check
This commit is contained in:
parent
1d93f15491
commit
e2593d3422
@ -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();
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user