mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
Merge pull request #2174 from Vexatos/no-crash-in-NBT
Fix robots duplicating with SpongeForge.
This commit is contained in:
commit
6e1270ef08
@ -765,7 +765,11 @@ class Machine(val host: MachineHost) extends prefab.ManagedEnvironment with mach
|
|||||||
})
|
})
|
||||||
|
|
||||||
override def save(nbt: NBTTagCompound): Unit = Machine.this.synchronized(state.synchronized {
|
override def save(nbt: NBTTagCompound): Unit = Machine.this.synchronized(state.synchronized {
|
||||||
assert(!isExecuting) // Lock on 'this' should guarantee this.
|
// The lock on 'this' should guarantee that this never happens regularly.
|
||||||
|
// If something other than regular saving tries to save while we are executing code,
|
||||||
|
// e.g. SpongeForge saving during robot.move due to block changes being captured,
|
||||||
|
// just don't save this at all. What could possibly go wrong?
|
||||||
|
if(isExecuting) return
|
||||||
|
|
||||||
if (SaveHandler.savingForClients) {
|
if (SaveHandler.savingForClients) {
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user