Skip to content

Commit b3d3595

Browse files
committed
Push undo state before drawing pattern if stack is empty
1 parent b841420 commit b3d3595

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ class SplicingTableBlockEntity(pos: BlockPos, state: BlockState) : BlockEntity(
149149
val data = getData(player, selection)
150150
?.let(ReadWriteList::convertOrNull)
151151
?: return errorResult
152+
if (undoStack.size == 0) {
153+
data.pushUndoState(
154+
list = Some(data.list),
155+
clipboard = Some(data.clipboard),
156+
selection = Some(selection),
157+
)
158+
}
152159
return drawPattern(pattern, data).also { consumeMedia(data) }
153160
}
154161

0 commit comments

Comments
 (0)