Initialize components in client tile entities when loading / receiving description packet. Should fix #1801.

This commit is contained in:
Florian Nücke 2016-05-14 13:59:31 +02:00
parent ca5d95cff5
commit cdd59cff05

View File

@ -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) { override def onConnect(node: Node) {
super.onConnect(node) super.onConnect(node)
if (node == this.node) { if (node == this.node) {
@ -122,5 +136,6 @@ trait ComponentInventory extends Environment with Inventory with inventory.Compo
override def readFromNBTForClient(nbt: NBTTagCompound) { override def readFromNBTForClient(nbt: NBTTagCompound) {
super.readFromNBTForClient(nbt) super.readFromNBTForClient(nbt)
load(nbt) load(nbt)
connectComponents()
} }
} }