fixes disconnects when waila is installed on server and client

This commit is contained in:
Florian Nücke 2014-01-23 22:46:41 +01:00
parent cc98b71884
commit 0d5a1af825
2 changed files with 12 additions and 8 deletions

View File

@ -131,7 +131,9 @@ abstract class Computer(isRemote: Boolean) extends Environment with ComponentInv
override def writeToNBT(nbt: NBTTagCompound) { override def writeToNBT(nbt: NBTTagCompound) {
super.writeToNBT(nbt) super.writeToNBT(nbt)
nbt.setNewCompoundTag(Settings.namespace + "computer", computer.save) if (!new Exception().getStackTrace.exists(_.getClassName.startsWith("mcp.mobius.waila"))) {
nbt.setNewCompoundTag(Settings.namespace + "computer", computer.save)
}
} }
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)

View File

@ -189,13 +189,15 @@ class Rack extends Hub with PowerBalancer with Inventory with Rotatable with Bun
} }
override def writeToNBT(nbt: NBTTagCompound) { override def writeToNBT(nbt: NBTTagCompound) {
nbt.setNewTagList(Settings.namespace + "servers", servers map { if (!new Exception().getStackTrace.exists(_.getClassName.startsWith("mcp.mobius.waila"))) {
case Some(server) => nbt.setNewTagList(Settings.namespace + "servers", servers map {
val serverNbt = new NBTTagCompound() case Some(server) =>
server.save(serverNbt) val serverNbt = new NBTTagCompound()
serverNbt server.save(serverNbt)
case _ => new NBTTagCompound() serverNbt
}) case _ => new NBTTagCompound()
})
}
super.writeToNBT(nbt) super.writeToNBT(nbt)
nbt.setByteArray(Settings.namespace + "sides", sides.map(_.ordinal.toByte)) nbt.setByteArray(Settings.namespace + "sides", sides.map(_.ordinal.toByte))
nbt.setNewTagList(Settings.namespace + "terminals", terminals.map(t => { nbt.setNewTagList(Settings.namespace + "terminals", terminals.map(t => {