This commit is contained in:
AigleDev 2019-09-12 21:21:23 +02:00
parent ba86f28994
commit 0d8526372e

View File

@ -804,8 +804,10 @@ public class FactionsPlayerListener implements Listener {
Block block = event.getClickedBlock();
Player player = event.getPlayer();
// Check if the material is bypassing protection
if (block == null || event.getItem() == null) return; // clicked in air, apparently
if (Conf.territoryBypassProtectedMaterials.contains(event.getItem().getType())) return;
if (block == null) return; // clicked in air, apparently
if(event.getItem() != null) {
if (Conf.territoryBypassProtectedMaterials.contains(event.getItem().getType())) return;
}
if (GetPermissionFromUsableBlock(event.getClickedBlock().getType()) != null) {
if (!canPlayerUseBlock(player, block, false)) {
event.setCancelled(true);