From cdd59cff050fbc5f289d8e30b3fc7c6d40af6be5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 14 May 2016 13:59:31 +0200 Subject: [PATCH] Initialize components in client tile entities when loading / receiving description packet. Should fix #1801. --- .../tileentity/traits/ComponentInventory.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/scala/li/cil/oc/common/tileentity/traits/ComponentInventory.scala b/src/main/scala/li/cil/oc/common/tileentity/traits/ComponentInventory.scala index cf63c1729..a2551cb49 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/traits/ComponentInventory.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/traits/ComponentInventory.scala @@ -98,6 +98,20 @@ trait ComponentInventory extends Environment with Inventory with inventory.Compo // ----------------------------------------------------------------------- // + override protected def initialize(): Unit = { + super.initialize() + if (isClient) { + connectComponents() + } + } + + override def dispose(): Unit = { + super.dispose() + if (isClient) { + disconnectComponents() + } + } + override def onConnect(node: Node) { super.onConnect(node) if (node == this.node) { @@ -122,5 +136,6 @@ trait ComponentInventory extends Environment with Inventory with inventory.Compo override def readFromNBTForClient(nbt: NBTTagCompound) { super.readFromNBTForClient(nbt) load(nbt) + connectComponents() } }