Fix build perms item use event not working correctly.

This commit is contained in:
sk89q 2015-01-15 18:42:26 -08:00
parent 41d922cb27
commit 159de771bf

View File

@ -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);
}