Merge pull request #8 from AigleDev/patch

Fix an NPE
This commit is contained in:
Driftay 2019-09-12 18:50:58 -04:00 committed by GitHub
commit b06e6e0f04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -805,7 +805,9 @@ public class FactionsPlayerListener implements Listener {
Player player = event.getPlayer();
// Check if the material is bypassing protection
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);