Java Code Examples for net.minecraft.block.Block#equals()

The following examples show how to use net.minecraft.block.Block#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayerControllerMPHook.java    From SkyblockAddons with MIT License 6 votes vote down vote up
public static void onPlayerDestroyBlock(BlockPos loc, ReturnValue<Boolean> returnValue) {
    SkyblockAddons main = SkyblockAddons.getInstance();
    Minecraft mc = Minecraft.getMinecraft();
    ItemStack heldItem = Minecraft.getMinecraft().thePlayer.getHeldItem();
    if (heldItem != null) {
        Block block = mc.theWorld.getBlockState(loc).getBlock();
        if (main.getUtils().isOnSkyblock()
                && main.getConfigValues().isEnabled(Feature.SHOW_ITEM_COOLDOWNS)
                && (block.equals(Blocks.log) || block.equals(Blocks.log2))) {
            if(InventoryUtils.JUNGLE_AXE_DISPLAYNAME.equals(heldItem.getDisplayName())
                || InventoryUtils.TREECAPITATOR_DISPLAYNAME.equals(heldItem.getDisplayName())) {
                CooldownManager.put(heldItem);
            }
        }
    }
}
 
Example 2
Source File: Carving.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
public CarvingGroup getGroup(Block block, int metadata)
{
    if(block.equals(Blocks.stone))
        block = Blocks.stonebrick;

    // Check name first
    CarvingGroup res;
    int i = OreDictionary.getOreID(block.getUnlocalizedName());
    if(i < 1)
        return null;

    //if((res = carvingGroupsByOre.get(OreDictionary.getOreIDs(new ItemStack(block, 1, metadata)))) != null)
    //    return res;

    if((res = carvingGroupsByVariation.get(key(block, metadata))) != null)
        return res;

    return null;
}
 
Example 3
Source File: EntitySmashingRock.java    From Chisel with GNU General Public License v2.0 6 votes vote down vote up
public static void smash(World world, int x, int y, int z)
{
    Block block = world.getBlock(x, y, z);
    int meta = world.getBlockMetadata(x, y, z);
    Block resBlock = block;
    int resMeta = meta;

    if(block.equals(Blocks.stone))
    {
        resBlock = Blocks.cobblestone;
    } else if(block.equals(Blocks.stonebrick) && meta == 0)
    {
        resMeta = 2;
    } else if(block.equals(Blocks.cobblestone))
    {
        resBlock = Blocks.sand;
    } else if(block.equals(Blocks.sand))
    {
        resBlock = Blocks.gravel;
    }

    if(resBlock.equals(block) && resMeta == meta)
        return;
    world.setBlock(x, y, z, resBlock, resMeta, 3);
}
 
Example 4
Source File: EntityBallOMoss.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
public static void turnToMoss(World world, int x, int y, int z) {
	Block block = world.getBlock(x, y, z);
	int meta = world.getBlockMetadata(x, y, z);
	Block resBlock = block;
	int resMeta = meta;

	if (block.equals(Blocks.cobblestone)) {
		resBlock = Blocks.mossy_cobblestone;
	} else if (block.equals(Blocks.cobblestone_wall) && meta == 0) {
		resMeta = 1;
	} else if (block.equals(ChiselBlocks.cobblestone)) {
		resBlock = ChiselBlocks.mossy_cobblestone;
	} else if (block.equals(ChiselBlocks.templeblock)) {
		resBlock = ChiselBlocks.mossy_templeblock;
	} else if (block.equals(Blocks.stonebrick)) {
		resMeta = 1;
	}

	if (resBlock.equals(block) && resMeta == meta)
		return;
	world.setBlock(x, y, z, resBlock, resMeta, 3);
}
 
Example 5
Source File: EntitySmashingRock.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
public static void smash(World world, int x, int y, int z) {
	Block block = world.getBlock(x, y, z);
	int meta = world.getBlockMetadata(x, y, z);
	Block resBlock = block;
	int resMeta = meta;

	if (block.equals(Blocks.stone)) {
		resBlock = Blocks.cobblestone;
	} else if (block.equals(Blocks.stonebrick) && meta == 0) {
		resMeta = 2;
	} else if (block.equals(Blocks.cobblestone)) {
		resBlock = Blocks.gravel;
	} else if (block.equals(Blocks.gravel)) {
		resBlock = Blocks.sand;
	}

	if (resBlock.equals(block) && resMeta == meta)
		return;
	world.setBlock(x, y, z, resBlock, resMeta, 3);
}
 
Example 6
Source File: WandHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void handleWandInteract(World world, int x, int y, int z, EntityPlayer entityPlayer, ItemStack i) {
    Block target = world.getBlock(x, y, z);
    if(target == null) return;

    if(ModConfig.enableAdditionalNodeTypes) {
        if (target.equals(Blocks.glass)) {
            if (ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), "NODEJAR")) {
                tryTCJarNodeCreation(i, entityPlayer, world, x, y, z);
            }
        } else if (target.equals(ConfigBlocks.blockWarded)) {
            if (RegisteredIntegrations.automagy.isPresent() &&
                    ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), "ADVNODEJAR")) {
                tryAutomagyJarNodeCreation(i, entityPlayer, world, x, y, z);
            }
        }
    }

    if(target.equals(ConfigBlocks.blockCrystal)) {
        if (ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_CORE"))
            tryAuraCoreCreation(i, entityPlayer, world, x, y, z);
    }
}
 
Example 7
Source File: ItemMarbleSlab.java    From Chisel with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack)
{
    BlockMarbleSlab block = (BlockMarbleSlab) Block.getBlockFromItem(this);

    switch(side)
    {
        case 0:
            --y;
            break;
        case 1:
            ++y;
            break;
        case 2:
            --z;
            break;
        case 3:
            ++z;
            break;
        case 4:
            --x;
            break;
        case 5:
            ++x;
            break;
    }

    Block targetBlock = world.getBlock(x, y, z);
    int meta = world.getBlockMetadata(x, y, z);

    return (targetBlock.equals(block) || targetBlock.equals(block.top)) && meta == stack.getItemDamage() || world.canPlaceEntityOnSide(block, x, y, z, false, side, (Entity) null, stack);

}
 
Example 8
Source File: ItemBlockKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
    ForgeDirection placedAgainstDir = ForgeDirection.getOrientation(side);
    Block placedAgainst = world.getBlock(x, y, z);
    int againstMeta = world.getBlockMetadata(x, y, z);
    if(placedAgainstDir.equals(ForgeDirection.UP) && placedAgainst.equals(ConfigBlocks.blockStoneDevice) && againstMeta == 1) {
        if(world.isAirBlock(x, y + 2, z)) {
            return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
        } else {
            return false;
        }
    } else {
        return false;
    }
}
 
Example 9
Source File: AuraEffects.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) {
    Block selected = world.getBlock(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ);
    if(selected.equals(Blocks.water) && world.getBlockMetadata(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ) == 0) {
        world.setBlock(selectedBlock.posX, selectedBlock.posY, selectedBlock.posZ, Blocks.ice);
    }
}
 
Example 10
Source File: TileEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean isMultiblockableBlock(int yOffset) {
    Block block = worldObj.getBlock(xCoord, yCoord + yOffset, zCoord);
    TileEntity te = worldObj.getTileEntity(xCoord, yCoord + yOffset, zCoord);
    if(!block.equals(RegisteredBlocks.blockEssentiaCompressor)) return false;
    if(te == null || !(te instanceof TileEssentiaCompressor)) return false;
    TileEssentiaCompressor compressor = (TileEssentiaCompressor) te;
    return compressor.multiblockId == multiblockId;
}
 
Example 11
Source File: TileEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
public TileEssentiaCompressor tryFindMasterTile() {
    if(!isMultiblockFormed()) return null;
    if(isMasterTile()) return this; //lul.. check before plz.
    Block down = worldObj.getBlock(xCoord, yCoord - multiblockYIndex, zCoord);
    if(!down.equals(RegisteredBlocks.blockEssentiaCompressor)) return null;
    TileEntity te = worldObj.getTileEntity(xCoord, yCoord - multiblockYIndex, zCoord);
    if(te == null || !(te instanceof TileEssentiaCompressor)) return null;
    TileEssentiaCompressor compressor = (TileEssentiaCompressor) te;
    if(compressor.multiblockId != multiblockId || !compressor.isMasterTile()) return null;
    return compressor;
}
 
Example 12
Source File: TileEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean checkPedestal(Vector3 coordPedestal) {
    Block at = worldObj.getBlock(
            coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
    int md = worldObj.getBlockMetadata(
            coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
    TileEntity te = worldObj.getTileEntity(
            coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
    if(at == null || te == null || md != 1) return false;
    if(!at.equals(RegisteredBlocks.blockStoneMachine) || !(te instanceof TilePedestal)) return false;
    ItemStack st = ((TilePedestal) te).getStackInSlot(0);
    if(st == null || st.getItem() == null) return false;
    return st.getItem().equals(RegisteredItems.itemElement) && st.getItemDamage() == 0;
}
 
Example 13
Source File: TileKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void checkSurroundings() {
    this.surroundingKnowledge = 0;
    for (int xx = -SURROUNDINGS_SEARCH_XZ; xx <= SURROUNDINGS_SEARCH_XZ; xx++) {
        for (int zz = -SURROUNDINGS_SEARCH_XZ;  zz <= SURROUNDINGS_SEARCH_XZ;  zz++) {

            lblYLoop:
            for (int yy = -SURROUNDINGS_SEARCH_Y; yy <= SURROUNDINGS_SEARCH_Y; yy++) {
                int absX = xx + xCoord;
                int absY = yy + yCoord;
                int absZ = zz + zCoord;
                Block at = worldObj.getBlock(absX, absY, absZ);
                int meta = worldObj.getBlockMetadata(absX, absY, absZ);
                TileEntity te = worldObj.getTileEntity(absX, absY, absZ);
                if(at.equals(Blocks.bookshelf)) {
                    this.surroundingKnowledge += 1;
                } else if(te != null && te instanceof IKnowledgeProvider) {
                    this.surroundingKnowledge += ((IKnowledgeProvider) te).getProvidedKnowledge(worldObj, absX, absY, absZ);
                } else if(at instanceof IKnowledgeProvider) {
                    this.surroundingKnowledge += ((IKnowledgeProvider) at).getProvidedKnowledge(worldObj, absX, absY, absZ);
                } else {
                    for (BlockSnapshot sn : knowledgeIncreaseMap.keySet()) {
                        if(sn.block.equals(at) && sn.metadata == meta) {
                            this.surroundingKnowledge += knowledgeIncreaseMap.get(sn);
                            continue lblYLoop;
                        }
                    }
                }
            }
        }
    }
}
 
Example 14
Source File: TileNodeManipulator.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean checkEldritchEyes(boolean checkForEyes) {
    bufferedCCPedestals.clear();

    int validPedestalsFound = 0;

    labelIt: for (int xDiff = -8; xDiff <= 8; xDiff++) {
        labelZ: for (int zDiff = -8; zDiff <= 8; zDiff++) {
            for (int yDiff = -5; yDiff <= 10; yDiff++) {
                int itX = xCoord + xDiff;
                int itY = yCoord + yDiff;
                int itZ = zCoord + zDiff;

                Block block = worldObj.getBlock(itX, itY, itZ);
                int meta = worldObj.getBlockMetadata(itX, itY, itZ);
                TileEntity te = worldObj.getTileEntity(itX, itY, itZ);
                if(block != null && block.equals(RegisteredBlocks.blockStoneMachine) && meta == 1
                        && te != null && te instanceof TilePedestal && (!checkForEyes || checkTile((TilePedestal) te))) {
                    validPedestalsFound++;
                    bufferedCCPedestals.add(new ChunkCoordinates(itX, itY, itZ));
                    if(validPedestalsFound >= 4) {
                        break labelIt;
                    }
                    continue labelZ;
                }
            }
        }
    }
    return validPedestalsFound >= 4;
}
 
Example 15
Source File: BlockKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
    if(world.isRemote) return;
    Block lower = world.getBlock(x, y - 1, z);
    int metaLower = world.getBlockMetadata(x, y - 1, z);
    if(!lower.equals(ConfigBlocks.blockStoneDevice) || metaLower != 1) {
        breakThisBlock(world, x, y, z);
    }
    if(!world.isAirBlock(x, y + 1, z)) {
        breakThisBlock(world, x, y, z);
    }
}
 
Example 16
Source File: BlockEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean isMultiblockable(World world, int x, int y, int z) {
    Block block = world.getBlock(x, y, z);
    TileEntity te = world.getTileEntity(x, y, z);
    if(!block.equals(RegisteredBlocks.blockEssentiaCompressor)) return false;
    if(te == null || !(te instanceof TileEssentiaCompressor)) return false;
    TileEssentiaCompressor compressor = (TileEssentiaCompressor) te;
    return !compressor.isMultiblockFormed();
}
 
Example 17
Source File: BlockOptionHelper.java    From ForgeHax with MIT License 5 votes vote down vote up
public static void requiresValidBlock(Block block, int metadataId)
    throws BlockDoesNotExistException {
  if (block == null || block.equals(Blocks.AIR)) {
    throw new BlockDoesNotExistException("Attempted to create entry for a non-existent block");
  }
  if (!BlockOptionHelper.isValidMetadataValue(block, metadataId)) {
    throw new BlockDoesNotExistException(
        String.format(
            "Attempted to create entry for block \"%s\" with a invalid meta id of \"%d\"",
            block.getRegistryName().toString(), metadataId));
  }
}
 
Example 18
Source File: CaveFinderHack.java    From Wurst7 with GNU General Public License v3.0 5 votes vote down vote up
private void replaceSearchersWithDifferentBlock(Block currentBlock)
{
	for(ChunkSearcher oldSearcher : new ArrayList<>(searchers.values()))
	{
		if(currentBlock.equals(oldSearcher.block))
			continue;
		
		removeSearcher(oldSearcher);
		addSearcher(oldSearcher.chunk, currentBlock);
	}
}
 
Example 19
Source File: BW_Util.java    From bartworks with MIT License 4 votes vote down vote up
/**
 * @param aBaseMetaTileEntity the Multiblock controller, usually a parameter
 * @param radius              the radius of the layer
 * @param yLevel              the starting y level of the Layer, referenced to the Multiblock
 * @param height              the height of the Layers, referenced to the Multiblock
 * @param block               the block for the walls
 * @param offset              the offset in most cases should be the same as the radius
 * @param controllerLayer     if the layer contains the controller
 * @param freeCorners         if the corners should be checked
 * @param insideCheck         if the inside should be empty/filled
 * @param inside              which block should be inside
 * @param allowHatches        if hatches are allowed in this Layer
 * @param aBaseCasingIndex    the Index for the hatches texture
 * @return if the layer check was completed
 */
public static boolean check_layer(IGregTechTileEntity aBaseMetaTileEntity, int radius, int yLevel, int height, Block block, int dmg, int offset, boolean controllerLayer, boolean freeCorners, boolean insideCheck, Block inside, int dmginside, boolean allowHatches, int aBaseCasingIndex) {
    int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * offset;
    int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * offset;
    for (int x = -radius; x <= radius; x++) {
        for (int y = yLevel; y < height; y++) {
            for (int z = -radius; z <= radius; z++) {
                if (freeCorners && (((Math.abs(x) == radius && Math.abs(z) == radius))))
                    continue;
                if (controllerLayer && (xDir + x == 0 && zDir + z == 0))
                    continue;
                boolean b = Math.abs(x) < radius && Math.abs(z) != radius;
                if (insideCheck && b) {
                    if (! (inside.equals(Blocks.air) ? aBaseMetaTileEntity.getAirOffset(xDir + x, y, zDir + z) : aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(inside) ) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmginside || dmginside > (-1))) {
                        if (!(allowHatches && (
                                ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                        ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                        ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                        ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                        ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                        ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex)
                        ))) {
                            return false;
                        }
                    }
                }
                if (!b && !aBaseMetaTileEntity.getBlockOffset(xDir + x, y, zDir + z).equals(block) && (aBaseMetaTileEntity.getMetaIDOffset(xDir + x, y, zDir + z) != dmg || dmg > (-1))) {
                    if (!(allowHatches && (
                            ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addDynamoToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                    ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addEnergyInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                    ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMaintenanceToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                    ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addMufflerToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                    ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addInputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex) ||
                                    ((GT_MetaTileEntity_MultiBlockBase) aBaseMetaTileEntity.getMetaTileEntity()).addOutputToMachineList(aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + x, y, zDir + z), aBaseCasingIndex)
                    ))) {
                        return false;
                    }
                }
            }
        }
    }
    return true;
}
 
Example 20
Source File: PlayerControllerMPHook.java    From SkyblockAddons with MIT License 4 votes vote down vote up
/**
 * Cancels stem breaks if holding an item, to avoid accidental breaking.
 */
public static void onPlayerDamageBlock(BlockPos loc, ReturnValue<Boolean> returnValue) {
    SkyblockAddons main = SkyblockAddons.getInstance();
    Minecraft mc = Minecraft.getMinecraft();
    EntityPlayerSP p = mc.thePlayer;
    ItemStack heldItem = p.getHeldItem();
    if (heldItem != null) {
        Block block = mc.theWorld.getBlockState(loc).getBlock();
        long now = System.currentTimeMillis();

        if (main.getConfigValues().isEnabled(Feature.AVOID_BREAKING_STEMS) && (block.equals(Blocks.melon_stem) || block.equals(Blocks.pumpkin_stem))) {
            if (main.getConfigValues().isEnabled(Feature.ENABLE_MESSAGE_WHEN_BREAKING_STEMS) && now - lastStemMessage > 20000) {
                lastStemMessage = now;
                main.getUtils().sendMessage(main.getConfigValues().getRestrictedColor(Feature.AVOID_BREAKING_STEMS) + Message.MESSAGE_CANCELLED_STEM_BREAK.getMessage());
            }
            returnValue.cancel();
        } else if (main.getConfigValues().isEnabled(Feature.ONLY_MINE_ORES_DEEP_CAVERNS) && DEEP_CAVERNS_LOCATIONS.contains(main.getUtils().getLocation())
                && main.getUtils().isPickaxe(heldItem.getItem()) && !DEEP_CAVERNS_MINEABLE_BLOCKS.contains(block)) {
            if (main.getConfigValues().isEnabled(Feature.ENABLE_MESSAGE_WHEN_MINING_DEEP_CAVERNS) && now - lastUnmineableMessage > 60000) {
                lastUnmineableMessage = now;
                main.getUtils().sendMessage(main.getConfigValues().getRestrictedColor(Feature.ONLY_MINE_ORES_DEEP_CAVERNS) + Message.MESSAGE_CANCELLED_NON_ORES_BREAK.getMessage());
            }
            returnValue.cancel();
        } else if (main.getConfigValues().isEnabled(Feature.ONLY_MINE_VALUABLES_NETHER) && Location.BLAZING_FORTRESS.equals(main.getUtils().getLocation()) &&
                main.getUtils().isPickaxe(heldItem.getItem()) && !NETHER_MINEABLE_BLOCKS.contains(block)) {
            if (main.getConfigValues().isEnabled(Feature.ENABLE_MESSAGE_WHEN_MINING_NETHER) && now - lastUnmineableMessage > 60000) {
                lastUnmineableMessage = now;
                main.getUtils().sendMessage(main.getConfigValues().getRestrictedColor(Feature.ONLY_MINE_VALUABLES_NETHER) + Message.MESSAGE_CANCELLED_NON_ORES_BREAK.getMessage());
            }
            returnValue.cancel();
        } else if (main.getConfigValues().isEnabled(Feature.ONLY_BREAK_LOGS_PARK) && PARK_LOCATIONS.contains(main.getUtils().getLocation())
                && main.getUtils().isAxe(heldItem.getItem()) && !LOGS.contains(block)) {
            if (main.getConfigValues().isEnabled(Feature.ENABLE_MESSAGE_WHEN_BREAKING_PARK) && now - lastUnmineableMessage > 60000) {
                lastUnmineableMessage = now;
                main.getUtils().sendMessage(main.getConfigValues().getRestrictedColor(Feature.ONLY_BREAK_LOGS_PARK) + Message.MESSAGE_CANCELLED_NON_LOGS_BREAK.getMessage());
            }
            returnValue.cancel();
        } else if (main.getConfigValues().isEnabled(Feature.JUNGLE_AXE_COOLDOWN)) {
            if ((block.equals(Blocks.log) || block.equals(Blocks.log2))
                    && p.getHeldItem() != null) {

                final boolean holdingJungleAxeOnCooldown = InventoryUtils.JUNGLE_AXE_DISPLAYNAME.equals(p.getHeldItem().getDisplayName()) && CooldownManager.isOnCooldown(InventoryUtils.JUNGLE_AXE_DISPLAYNAME);
                final boolean holdingTreecapitatorOnCooldown = InventoryUtils.TREECAPITATOR_DISPLAYNAME.equals(p.getHeldItem().getDisplayName()) && CooldownManager.isOnCooldown(InventoryUtils.TREECAPITATOR_DISPLAYNAME);

                if (holdingJungleAxeOnCooldown || holdingTreecapitatorOnCooldown) {
                    returnValue.cancel();
                }
            }
        }
    }
}