avoiding errors for upgrades that don't have a component and possibly timing issues (sending to client before it was initialized)

This commit is contained in:
Florian Nücke 2013-12-22 22:18:51 +01:00
parent c260ac0c7e
commit 73999ff939

View File

@ -45,6 +45,7 @@ class Robot(isRemote: Boolean) extends Computer(isRemote) with ISidedInventory w
// We're guaranteed to have a driver for entries.
environment.save(dataTag(Registry.driverFor(stack).get, stack))
ServerPacketSender.sendRobotEquippedUpgradeChange(this, stack)
case _ =>
}
}
@ -384,6 +385,7 @@ class Robot(isRemote: Boolean) extends Computer(isRemote) with ISidedInventory w
val stack = getStackInSlot(3)
// We're guaranteed to have a driver for entries.
environment.save(dataTag(Registry.driverFor(stack).get, stack))
case _ =>
}
nbt.setNewCompoundTag("upgrade", getStackInSlot(3).writeToNBT)
}