mirror of
https://github.com/songoda/UltimateTimber.git
synced 2025-01-26 09:21:21 +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.UltimateTimber;
|
||||||
import com.songoda.ultimatetimber.treefall.CustomLoot;
|
import com.songoda.ultimatetimber.treefall.CustomLoot;
|
||||||
import com.songoda.ultimatetimber.utils.Methods;
|
import com.songoda.ultimatetimber.utils.Methods;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class ReloadCommand {
|
public class ReloadCommand {
|
||||||
|
|
||||||
public static void reloadConfig(CommandSender commandSender) {
|
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();
|
UltimateTimber plugin = UltimateTimber.getInstance();
|
||||||
plugin.reloadConfig();
|
plugin.reloadConfig();
|
||||||
CustomLoot.initializeCustomItems();
|
CustomLoot.initializeCustomItems();
|
||||||
|
@ -32,6 +32,7 @@ public class TreeFallEvent implements Listener {
|
|||||||
TreeChecker treeChecker = new TreeChecker();
|
TreeChecker treeChecker = new TreeChecker();
|
||||||
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());
|
HashSet<Block> blocks = treeChecker.validTreeHandler(event.getBlock());
|
||||||
|
|
||||||
|
Bukkit.broadcastMessage(blocks.toString());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Previous list will be null if no valid tree is found
|
Previous list will be null if no valid tree is found
|
||||||
|
Loading…
Reference in New Issue
Block a user