@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
  public void onEntityExplode(EntityExplodeEvent event) {
    if (event.isCancelled()) return;

    // List<Block> blockList = event.blockList();
    int x; // , count = event.blockList().size();
    Block block;

    // Check the block list for any protected blocks, and cancel the event if any are found.

    for (x = 0; x < event.blockList().size(); ++x) {

      if (Lockette.explosionProtectionAll) {

        block = event.blockList().get(x);

        if (Lockette.isProtected(block)) {
          // event.setCancelled(true);
          // return;
          event.blockList().remove(x);
          --x;
          // --count;
          continue;
        }

        if ((block.getTypeId() == Material.CHEST.getId())
            || (block.getTypeId() == Material.DISPENSER.getId())
            || (block.getTypeId() == Material.FURNACE.getId())
            || (block.getTypeId() == Material.BURNING_FURNACE.getId())
            || (block.getTypeId() == Material.BREWING_STAND.getId())) {
          // event.setCancelled(true);
          // return;
          event.blockList().remove(x);
          --x;
          // --count;
          continue;
        }
      }
    }
  }
  @EventHandler(priority = EventPriority.HIGHEST)
  public void onPlayerInteract(PlayerInteractEvent event) {
    if (!event.hasBlock()) return;

    Action action = event.getAction();
    Player player = event.getPlayer();
    Block block = event.getClickedBlock();
    int type = block.getTypeId();
    BlockFace face = event.getBlockFace();

    if (action == Action.RIGHT_CLICK_BLOCK) {
      if (Lockette.protectTrapDoors)
        if (type == Material.TRAP_DOOR.getId()) {
          if (interactDoor(block, player)) return;

          event.setUseInteractedBlock(Result.DENY);
          event.setUseItemInHand(Result.DENY);
          return;
        }

      if (Lockette.protectDoors)
        if ((type == Material.WOODEN_DOOR.getId())
            || (type == Material.IRON_DOOR_BLOCK.getId())
            || (type == materialFenceGate)) {
          if (interactDoor(block, player)) return;

          event.setUseInteractedBlock(Result.DENY);
          event.setUseItemInHand(Result.DENY);
          return;
        }

      if (type == Material.WALL_SIGN.getId()) {
        interactSign(block, player);
        return;
      }

      if (type == Material.CHEST.getId()) {
        // Try at making a 1.7->1.8 chest fixer.
        Lockette.rotateChestOrientation(block, face);
      }

      if ((type == Material.CHEST.getId())
          || (type == Material.DISPENSER.getId())
          || (type == Material.FURNACE.getId())
          || (type == Material.BURNING_FURNACE.getId())
          || (type == Material.BREWING_STAND.getId())
          || Lockette.isInList(type, Lockette.customBlockList)) {

        // Trying something out....
        if (Lockette.directPlacement)
          if (event.hasItem())
            if ((face != BlockFace.UP) && (face != BlockFace.DOWN)) {
              ItemStack item = event.getItem();

              if (item.getTypeId() == Material.SIGN.getId()) {
                Block checkBlock = block.getRelative(face);

                type = checkBlock.getTypeId();

                if (type == Material.AIR.getId()) {
                  boolean place = false;

                  if (Lockette.isProtected(block)) {
                    // Add a users sign only if owner.
                    if (Lockette.isOwner(block, player.getName())) place = true;
                  } else place = true;
                  // if(Lockette.altPrivate == null){}//if(Lockette.altMoreUsers == null){}
                  if (place) {
                    // player.sendMessage(ChatColor.RED + "Lockette: Using a sign on a container");

                    event.setUseItemInHand(Result.ALLOW); // ? seems to work in 568
                    event.setUseInteractedBlock(Result.DENY);
                    return;
                  }
                }
              }
            }

        if (interactContainer(block, player)) return;

        event.setUseInteractedBlock(Result.DENY);
        event.setUseItemInHand(Result.DENY);
        return;
      }

      if (type == Material.DIRT.getId())
        if (event.hasItem()) {
          ItemStack item = event.getItem();

          type = item.getTypeId();

          if ((type == Material.DIAMOND_HOE.getId())
              || (type == Material.GOLD_HOE.getId())
              || (type == Material.IRON_HOE.getId())
              || (type == Material.STONE_HOE.getId())
              || (type == Material.WOOD_HOE.getId())) {
            Block checkBlock = block.getRelative(BlockFace.UP);

            type = checkBlock.getTypeId();

            if ((type == Material.WOODEN_DOOR.getId())
                || (type == Material.IRON_DOOR_BLOCK.getId())
                || (type == materialFenceGate)) {
              event.setUseInteractedBlock(Result.DENY);
              return;
            }
          }
        }
    } else if (action == Action.LEFT_CLICK_BLOCK) {
      if (Lockette.protectTrapDoors)
        if (type == Material.TRAP_DOOR.getId()) {
          if (interactDoor(block, player)) return;

          event.setUseInteractedBlock(Result.DENY);
          event.setUseItemInHand(Result.DENY);
          return;
        }

      if (Lockette.protectDoors)
        if ((type == Material.WOODEN_DOOR.getId())
            || (type == Material.IRON_DOOR_BLOCK.getId())
            || (type == materialFenceGate)) {
          if (interactDoor(block, player)) return;

          event.setUseInteractedBlock(Result.DENY);
          event.setUseItemInHand(Result.DENY);
          return;
        }
    }
  }