From 2739eae9726f6e31a2867b1f531a172afa6f682c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Tue, 29 Dec 2015 23:42:42 +0100 Subject: [PATCH] Update to TIS-3D 0.7.1. --- build.properties | 2 +- .../tis3d/SerialInterfaceProviderAdapter.scala | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/build.properties b/build.properties index 0806de2a2d..dea20af6b9 100644 --- a/build.properties +++ b/build.properties @@ -39,7 +39,7 @@ rc.cf=2219/321 rc.version=1.7.10-9.4.0.0 redlogic.version=59.0.3 rotc.version=V5c -tis3d.version=MC1.7.10-0.7.0.50 +tis3d.version=MC1.7.10-0.7.1.53 tmech.version=75.0afb56c re.version=3.0.0.342 waila.version=1.5.8a diff --git a/src/main/scala/li/cil/oc/integration/tis3d/SerialInterfaceProviderAdapter.scala b/src/main/scala/li/cil/oc/integration/tis3d/SerialInterfaceProviderAdapter.scala index 7425853f40..babaa55307 100644 --- a/src/main/scala/li/cil/oc/integration/tis3d/SerialInterfaceProviderAdapter.scala +++ b/src/main/scala/li/cil/oc/integration/tis3d/SerialInterfaceProviderAdapter.scala @@ -17,6 +17,7 @@ import li.cil.tis3d.api.prefab.manual.ResourceContentProvider import li.cil.tis3d.api.serial.SerialInterface import li.cil.tis3d.api.serial.SerialInterfaceProvider import li.cil.tis3d.api.serial.SerialProtocolDocumentationReference +import net.minecraft.nbt.NBTTagCompound import net.minecraft.util.EnumFacing import net.minecraft.world.World @@ -105,6 +106,20 @@ object SerialInterfaceProviderAdapter extends SerialInterfaceProvider { }) } + override def readFromNBT(nbt: NBTTagCompound): Unit = { + writeBuffer.clear() + writeBuffer ++= nbt.getIntArray("writeBuffer").map(_.toShort) + readBuffer.clear() + readBuffer ++= nbt.getIntArray("readBuffer").map(_.toShort) + isReading = nbt.getBoolean("isReading") + } + + override def writeToNBT(nbt: NBTTagCompound): Unit = { + nbt.setIntArray("writeBuffer", writeBuffer.toArray.map(_.toInt)) + nbt.setIntArray("readBuffer", readBuffer.toArray.map(_.toInt)) + nbt.setBoolean("isReading", isReading) + } + private def ensureConnected(): Unit = { if (tileEntity.node.network != node.network) { tileEntity.node.connect(node)