This commit is contained in:
Vexatos 2016-12-10 16:10:37 +01:00
parent 1d5c69924f
commit f48dfee32d

View File

@ -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 {
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) {
return