Skip to content

Commit 88c55d1

Browse files
committed
refactor: improve power state handling in AntiFieldBlock
1 parent 2a2a391 commit 88c55d1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/kotlin/dev/aaronhowser/mods/geneticsresequenced/block/AntiFieldBlock.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,12 @@ class AntiFieldBlock : Block(
4444
pNeighborPos: BlockPos,
4545
pMovedByPiston: Boolean
4646
) {
47-
4847
val isPowered = pLevel.hasNeighborSignal(pPos)
48+
val wasPowered = pState.getValue(DISABLED)
4949

50-
if (pState.getValue(DISABLED) != isPowered) {
51-
pLevel.setBlock(pPos, pState.setValue(DISABLED, isPowered), 2)
50+
if (isPowered != wasPowered) {
51+
pLevel.setBlock(pPos, pState.setValue(DISABLED, isPowered), 3)
5252
}
53-
5453
}
5554

5655
companion object {

0 commit comments

Comments
 (0)