From 780435a4a8594ed3c172fbb4c5bf240a70199042 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 18 Sep 2024 10:35:33 +0200 Subject: Fix: Tungsten Detection on Alpha (#2437) Co-authored-by: Empa <42304516+itsempa@users.noreply.github.com> Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../hannibal2/skyhanni/features/mining/OreBlock.kt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/OreBlock.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/OreBlock.kt index c5d9774b1..d9b76a35b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/mining/OreBlock.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/mining/OreBlock.kt @@ -10,6 +10,7 @@ import at.hannibal2.skyhanni.data.MiningAPI.inSpidersDen import at.hannibal2.skyhanni.utils.CollectionUtils.equalsOneOf import net.minecraft.block.BlockColored import net.minecraft.block.BlockSand +import net.minecraft.block.BlockSilverfish import net.minecraft.block.BlockStainedGlass import net.minecraft.block.BlockStainedGlassPane import net.minecraft.block.BlockStone @@ -222,7 +223,7 @@ enum class OreBlock( checkArea = { inGlacite }, ), LOW_TIER_TUNGSTEN( - checkBlock = { it.block == Blocks.cobblestone }, + checkBlock = ::isLowTierTungsten, checkArea = { inGlacite }, ), HIGH_TIER_TUNGSTEN( @@ -240,12 +241,10 @@ enum class OreBlock( } } -private fun isLowTierMithril(state: IBlockState): Boolean { - return when (state.block) { - Blocks.wool -> state.getValue(BlockColored.COLOR) == EnumDyeColor.GRAY - Blocks.stained_hardened_clay -> state.getValue(BlockColored.COLOR) == EnumDyeColor.CYAN - else -> false - } +private fun isLowTierMithril(state: IBlockState): Boolean = when (state.block) { + Blocks.wool -> state.getValue(BlockColored.COLOR) == EnumDyeColor.GRAY + Blocks.stained_hardened_clay -> state.getValue(BlockColored.COLOR) == EnumDyeColor.CYAN + else -> false } private fun isHighTierMithril(state: IBlockState): Boolean { @@ -270,18 +269,21 @@ private fun isHardStoneHollows(state: IBlockState): Boolean { } private fun isHardstoneGlacite(state: IBlockState): Boolean = - (state.block == Blocks.stone && state.getValue(BlockStone.VARIANT) == BlockStone.EnumType.STONE) || + (state.block == Blocks.monster_egg && state.getValue(BlockSilverfish.VARIANT) == BlockSilverfish.EnumType.STONE) || (state.block == Blocks.wool && state.getValue(BlockColored.COLOR) == EnumDyeColor.GRAY) private fun isRedSand(state: IBlockState): Boolean = (state.block == Blocks.sand && state.getValue(BlockSand.VARIANT) == BlockSand.EnumType.RED_SAND) -private fun isLowTierUmber(state: IBlockState): Boolean = state.block == Blocks.hardened_clay || - (state.block == Blocks.stained_hardened_clay && state.getValue(BlockColored.COLOR) == EnumDyeColor.BROWN) +private fun isLowTierUmber(state: IBlockState): Boolean = + state.block == Blocks.hardened_clay || (state.block == Blocks.stained_hardened_clay && state.getValue(BlockColored.COLOR) == EnumDyeColor.BROWN) private fun isHighTierUmber(state: IBlockState): Boolean = (state.block == Blocks.double_stone_slab2 && state.getValue(BlockStoneSlabNew.VARIANT) == BlockStoneSlabNew.EnumType.RED_SANDSTONE) +private fun isLowTierTungsten(state: IBlockState): Boolean = + state.block == Blocks.monster_egg && state.getValue(BlockSilverfish.VARIANT) == BlockSilverfish.EnumType.COBBLESTONE + private fun IBlockState.isGemstoneWithColor(color: EnumDyeColor): Boolean { return when (this.block) { Blocks.stained_glass -> color == this.getValue(BlockStainedGlass.COLOR) -- cgit