Skip to content

Commit 5a0f3bc

Browse files
committed
Don't remove splicing table during upgrade (fix #47)
1 parent cd0cbf6 commit 5a0f3bc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Common/src/main/kotlin/gay/object/hexdebug/blocks/splicing/SplicingTableBlock.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,13 @@ class SplicingTableBlock(properties: Properties, val enlightened: Boolean) : Bas
7979
newState: BlockState,
8080
movedByPiston: Boolean
8181
) {
82-
if (state.block != newState.block) {
82+
// don't drop contents or remove block entity during a table upgrade
83+
if (newState.block !is SplicingTableBlock) {
8384
getBlockEntity(level, pos)?.let {
8485
Containers.dropContents(level, pos, it)
8586
}
87+
super.onRemove(state, level, pos, newState, movedByPiston)
8688
}
87-
super.onRemove(state, level, pos, newState, movedByPiston)
8889
}
8990

9091
override fun hasAnalogOutputSignal(state: BlockState) = true

0 commit comments

Comments
 (0)