mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 01:10:19 -04:00
Fixed initial redstone state of non-updating blocks such as prints.
This commit is contained in:
parent
3a930fa938
commit
b48e2fdc8f
@ -4,6 +4,7 @@ import cpw.mods.fml.common.Optional
|
|||||||
import cpw.mods.fml.relauncher.Side
|
import cpw.mods.fml.relauncher.Side
|
||||||
import cpw.mods.fml.relauncher.SideOnly
|
import cpw.mods.fml.relauncher.SideOnly
|
||||||
import li.cil.oc.Settings
|
import li.cil.oc.Settings
|
||||||
|
import li.cil.oc.common.EventHandler
|
||||||
import li.cil.oc.integration.Mods
|
import li.cil.oc.integration.Mods
|
||||||
import li.cil.oc.integration.util.BundledRedstone
|
import li.cil.oc.integration.util.BundledRedstone
|
||||||
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
import li.cil.oc.server.{PacketSender => ServerPacketSender}
|
||||||
@ -75,13 +76,18 @@ trait RedstoneAware extends RotationAware with IConnectable with IRedstoneEmitte
|
|||||||
if (isServer) {
|
if (isServer) {
|
||||||
if (shouldUpdateInput) {
|
if (shouldUpdateInput) {
|
||||||
shouldUpdateInput = false
|
shouldUpdateInput = false
|
||||||
for (side <- ForgeDirection.VALID_DIRECTIONS) {
|
ForgeDirection.VALID_DIRECTIONS.foreach(updateRedstoneInput)
|
||||||
updateRedstoneInput(side)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def validate(): Unit = {
|
||||||
|
super.validate()
|
||||||
|
if (!canUpdate) {
|
||||||
|
EventHandler.schedule(() => ForgeDirection.VALID_DIRECTIONS.foreach(updateRedstoneInput))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def updateRedstoneInput(side: ForgeDirection) {
|
def updateRedstoneInput(side: ForgeDirection) {
|
||||||
input(side, BundledRedstone.computeInput(position, side))
|
input(side, BundledRedstone.computeInput(position, side))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user