aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-09-18 10:35:33 +0200
committerGitHub <noreply@github.com>2024-09-18 10:35:33 +0200
commit780435a4a8594ed3c172fbb4c5bf240a70199042 (patch)
treebb33ea1d4acbb923295716f9cdd35e4f024f9354 /src/main/java/at/hannibal2/skyhanni/features/mining
parentc614724dd0a92d89fa96c3468be156a407f924db (diff)
downloadskyhanni-780435a4a8594ed3c172fbb4c5bf240a70199042.tar.gz
skyhanni-780435a4a8594ed3c172fbb4c5bf240a70199042.tar.bz2
skyhanni-780435a4a8594ed3c172fbb4c5bf240a70199042.zip
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>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/OreBlock.kt22
1 files changed, 12 insertions, 10 deletions
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)