mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
fixed robots not storing their orientation. and redstone output. since the the save code cleanup. herp derp.
This commit is contained in:
parent
e03bede4c3
commit
ef665390b4
@ -19,11 +19,11 @@ import scala.Array
|
||||
))
|
||||
trait BundledRedstoneAware extends RedstoneAware with IBundledEmitter with IBundledUpdatable with IBundledTile {
|
||||
|
||||
private val _bundledInput = Array.fill(6)(Array.fill(16)(-1))
|
||||
protected[tileentity] val _bundledInput = Array.fill(6)(Array.fill(16)(-1))
|
||||
|
||||
private val _rednetInput = Array.fill(6)(Array.fill(16)(-1))
|
||||
protected[tileentity] val _rednetInput = Array.fill(6)(Array.fill(16)(-1))
|
||||
|
||||
private val _bundledOutput = Array.fill(6)(Array.fill(16)(0))
|
||||
protected[tileentity] val _bundledOutput = Array.fill(6)(Array.fill(16)(0))
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
|
@ -15,9 +15,9 @@ import net.minecraftforge.common.ForgeDirection
|
||||
new Optional.Interface(iface = "mods.immibis.redlogic.api.wiring.IRedstoneUpdatable", modid = "RedLogic")
|
||||
))
|
||||
trait RedstoneAware extends RotationAware with IConnectable with IRedstoneEmitter with IRedstoneUpdatable {
|
||||
protected val _input = Array.fill(6)(-1)
|
||||
protected[tileentity] val _input = Array.fill(6)(-1)
|
||||
|
||||
protected val _output = Array.fill(6)(0)
|
||||
protected[tileentity] val _output = Array.fill(6)(0)
|
||||
|
||||
protected var _isOutputEnabled = false
|
||||
|
||||
|
@ -134,26 +134,20 @@ class RobotProxy(val robot: Robot) extends Computer(robot.isClient) with ISidedI
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
override protected[tileentity] val _input = robot._input
|
||||
|
||||
override protected[tileentity] val _output = robot._output
|
||||
|
||||
override protected[tileentity] val _bundledInput = robot._bundledInput
|
||||
|
||||
override protected[tileentity] val _rednetInput = robot._rednetInput
|
||||
|
||||
override protected[tileentity] val _bundledOutput = robot._bundledOutput
|
||||
|
||||
override def isOutputEnabled = robot.isOutputEnabled
|
||||
|
||||
override def isOutputEnabled_=(value: Boolean) = robot.isOutputEnabled_=(value)
|
||||
|
||||
override def input(side: ForgeDirection) = robot.input(side)
|
||||
|
||||
override def output(side: ForgeDirection) = robot.output(side)
|
||||
|
||||
override def output(side: ForgeDirection, value: Int) = robot.output(side, value)
|
||||
|
||||
override def bundledInput(side: ForgeDirection, color: Int) = robot.bundledInput(side, color)
|
||||
|
||||
override def rednetInput(side: ForgeDirection, color: Int, value: Int) = robot.rednetInput(side, color, value)
|
||||
|
||||
override def bundledOutput(side: ForgeDirection) = robot.bundledOutput(side)
|
||||
|
||||
override def bundledOutput(side: ForgeDirection, color: Int) = robot.bundledOutput(side, color)
|
||||
|
||||
override def bundledOutput(side: ForgeDirection, color: Int, value: Int) = robot.bundledOutput(side, color, value)
|
||||
|
||||
override def checkRedstoneInputChanged() = robot.checkRedstoneInputChanged()
|
||||
|
||||
override def updateRedstoneInput() = robot.updateRedstoneInput()
|
||||
|
@ -164,31 +164,31 @@ trait Rotatable extends RotationAware with api.Rotatable {
|
||||
|
||||
override def readFromNBT(nbt: NBTTagCompound) = {
|
||||
super.readFromNBT(nbt)
|
||||
_pitch = ForgeDirection.getOrientation(nbt.getInteger(Settings.namespace + "pitch"))
|
||||
_yaw = ForgeDirection.getOrientation(nbt.getInteger(Settings.namespace + "yaw"))
|
||||
pitch = ForgeDirection.getOrientation(nbt.getInteger(Settings.namespace + "pitch"))
|
||||
yaw = ForgeDirection.getOrientation(nbt.getInteger(Settings.namespace + "yaw"))
|
||||
validatePitchAndYaw()
|
||||
updateTranslation()
|
||||
}
|
||||
|
||||
override def writeToNBT(nbt: NBTTagCompound) = {
|
||||
super.writeToNBT(nbt)
|
||||
nbt.setInteger(Settings.namespace + "pitch", _pitch.ordinal)
|
||||
nbt.setInteger(Settings.namespace + "yaw", _yaw.ordinal)
|
||||
nbt.setInteger(Settings.namespace + "pitch", pitch.ordinal)
|
||||
nbt.setInteger(Settings.namespace + "yaw", yaw.ordinal)
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def readFromNBTForClient(nbt: NBTTagCompound) {
|
||||
super.readFromNBTForClient(nbt)
|
||||
_pitch = ForgeDirection.getOrientation(nbt.getInteger("pitch"))
|
||||
_yaw = ForgeDirection.getOrientation(nbt.getInteger("yaw"))
|
||||
pitch = ForgeDirection.getOrientation(nbt.getInteger("pitch"))
|
||||
yaw = ForgeDirection.getOrientation(nbt.getInteger("yaw"))
|
||||
validatePitchAndYaw()
|
||||
updateTranslation()
|
||||
}
|
||||
|
||||
override def writeToNBTForClient(nbt: NBTTagCompound) {
|
||||
super.writeToNBTForClient(nbt)
|
||||
nbt.setInteger("pitch", _pitch.ordinal)
|
||||
nbt.setInteger("yaw", _yaw.ordinal)
|
||||
nbt.setInteger("pitch", pitch.ordinal)
|
||||
nbt.setInteger("yaw", yaw.ordinal)
|
||||
}
|
||||
|
||||
private def validatePitchAndYaw() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user