This should fix last issue

This commit is contained in:
SvenjaReißaus 2019-03-19 00:21:11 -05:00
parent c02af9207b
commit 6a24b34a70
No known key found for this signature in database
GPG Key ID: E5494A03FA36D54B
2 changed files with 8 additions and 6 deletions

View File

@ -752,13 +752,15 @@ public class FactionsPlayerListener implements Listener {
if (block == null) return; // clicked in air, apparently
SavageFactions.plugin.log("Checking for material permission");
if (GetPermissionFromUsableBlock(event.getClickedBlock().getType()) == null) return;
SavageFactions.plugin.log("Checking for use block permission");
if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY);
return;
if (GetPermissionFromUsableBlock(event.getClickedBlock().getType()) != null) {
SavageFactions.plugin.log("Checking for use block permission");
if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true);
event.setUseInteractedBlock(Event.Result.DENY);
return;
}
}
if (event.getMaterial().isSolid()) return;
SavageFactions.plugin.log("Checking if you can use that item");
if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) {
event.setCancelled(true);