Skip to content

Commit bcb6546

Browse files
committed
Get state a bit later
1 parent 5310b56 commit bcb6546

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

common/src/main/kotlin/com/lambda/config/groups/Targeting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ abstract class Targeting(
174174
}
175175
}
176176

177-
val illegalTargets = setOf(UUID.fromString("4f332cd7-cf93-427e-a282-53f45f6bb113"))
177+
private val illegalTargets = setOf(UUID.fromString("4f332cd7-cf93-427e-a282-53f45f6bb113"))
178178
}
179179

180180
/**

common/src/main/kotlin/com/lambda/module/modules/combat/CrystalAura.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,14 @@ object CrystalAura : Module(
129129
val maximumRange = ((1 - (placeMinDamage / 12.0)) * 12.0).toInt()
130130

131131
return BlockPos.iterateOutwards(target.blockPos, maximumRange, maximumRange, maximumRange).mapNotNull { pos ->
132-
targetData(pos, pos.blockState(world), target)
132+
targetData(pos, target)
133133
}.sortedWith(placeMethod.comparator)
134134
}
135135

136-
private fun SafeContext.targetData(pos: BlockPos, state: BlockState, target: LivingEntity): TargetPosition? {
136+
private fun SafeContext.targetData(pos: BlockPos, target: LivingEntity): TargetPosition? {
137137
val inRange = pos.dist(player.eyePos) < interact.reach + 1
138138
if (!inRange) return null
139+
val state = pos.blockState(world)
139140
val isOfBlock = state.isOf(Blocks.OBSIDIAN) || state.isOf(Blocks.BEDROCK)
140141
if (!isOfBlock) return null
141142
if (pos in placements) return null

0 commit comments

Comments
 (0)