Skip to content

Commit

Permalink
Update to TIS-3D 0.7.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
fnuecke committed Dec 29, 2015
1 parent 88c1876 commit 2739eae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2739eae

Please sign in to comment.