mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 02:45:13 -04:00
simple container action: commit action correctly
This commit is contained in:
parent
d046c69574
commit
ebb2e50387
@ -82,6 +82,7 @@ class SimpleContainerAction(
|
||||
target.item._count -= subtract
|
||||
floatingItem.item._count += subtract
|
||||
}
|
||||
target.commit(false)
|
||||
|
||||
if (floatingItem._valid) {
|
||||
container.floatingItem = floatingItem
|
||||
|
@ -198,11 +198,13 @@ class ItemStack {
|
||||
lock.lock()
|
||||
}
|
||||
|
||||
fun commit() {
|
||||
fun commit(unlock: Boolean = true) {
|
||||
if (!_valid) {
|
||||
holder?.container?._validate()
|
||||
}
|
||||
lock.unlock()
|
||||
if (unlock) {
|
||||
lock.unlock()
|
||||
}
|
||||
revision++
|
||||
holder?.container?.apply { revision++ } // increase revision after unlock to prevent deadlock
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user