Fix doors not covering all openables

This commit is contained in:
Fabrizio La Rosa 2020-07-28 23:26:10 +02:00
parent 8786cdd710
commit 959d52a431

View File

@ -9,6 +9,7 @@ import com.songoda.skyblock.permission.PermissionType;
import org.bukkit.entity.Player;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.material.Openable;
public class DoorPermission extends ListeningPermission {
@ -27,13 +28,10 @@ public class DoorPermission extends ListeningPermission {
if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK)
return;
CompatibleMaterial material = CompatibleMaterial.getMaterial(event.getClickedBlock());
Player player = event.getPlayer();
if (material == CompatibleMaterial.BIRCH_DOOR || material == CompatibleMaterial.ACACIA_DOOR
|| material == CompatibleMaterial.DARK_OAK_DOOR || material == CompatibleMaterial.JUNGLE_DOOR
|| material == CompatibleMaterial.SPRUCE_DOOR || material == CompatibleMaterial.OAK_DOOR)
if (event.getClickedBlock() instanceof Openable)
cancelAndMessage(event, player, plugin, messageManager);
}
}