mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 02:27:42 +01:00
Fix build perms item use event not working correctly.
This commit is contained in:
parent
41d922cb27
commit
159de771bf
@ -193,8 +193,12 @@ public void onUseItem(UseItemEvent event) {
|
||||
Player player = (Player) rootCause;
|
||||
Material material = event.getItemStack().getType();
|
||||
|
||||
if (material.isBlock()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasBuildPermission(player, "item." + material.name().toLowerCase() + ".use")
|
||||
|| hasBuildPermission(player, "item.use." + material.name().toLowerCase())) {
|
||||
&& !hasBuildPermission(player, "item.use." + material.name().toLowerCase())) {
|
||||
tellErrorMessage(player, event.getWorld());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user