mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 09:18:05 -04:00
Added setting to change delay enforced when changing redstone output.
This commit is contained in:
parent
ee3d2696c9
commit
e23378b662
@ -1194,6 +1194,11 @@ opencomputers {
|
|||||||
# properties, i.e. througput, frequency and buffer size.
|
# properties, i.e. througput, frequency and buffer size.
|
||||||
# Valid values are: 0 = none, 1 = tier 1, 2 = tier 2, 3 = tier 3.
|
# Valid values are: 0 = none, 1 = tier 1, 2 = tier 2, 3 = tier 3.
|
||||||
serverRackSwitchTier: 1
|
serverRackSwitchTier: 1
|
||||||
|
|
||||||
|
# Enforced delay when changing a redstone emitting component's output,
|
||||||
|
# such as the redstone card and redstone I/O block. Lowering this can
|
||||||
|
# have very negative impact on server TPS, so beware.
|
||||||
|
redstoneDelay: 0.1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Settings for mod integration (the mod previously known as OpenComponents).
|
# Settings for mod integration (the mod previously known as OpenComponents).
|
||||||
|
@ -335,6 +335,7 @@ class Settings(val config: Config) {
|
|||||||
val dataCardHardLimit = config.getInt("misc.dataCardHardLimit") max 0
|
val dataCardHardLimit = config.getInt("misc.dataCardHardLimit") max 0
|
||||||
val dataCardTimeout = config.getDouble("misc.dataCardTimeout") max 0
|
val dataCardTimeout = config.getDouble("misc.dataCardTimeout") max 0
|
||||||
val serverRackSwitchTier = (config.getInt("misc.serverRackSwitchTier") - 1) max Tier.None min Tier.Three
|
val serverRackSwitchTier = (config.getInt("misc.serverRackSwitchTier") - 1) max Tier.None min Tier.Three
|
||||||
|
val redstoneDelay = config.getDouble("misc.redstoneDelay") max 0
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
// printer
|
// printer
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package li.cil.oc.server.component
|
package li.cil.oc.server.component
|
||||||
|
|
||||||
|
import li.cil.oc.Settings
|
||||||
import li.cil.oc.api.driver.EnvironmentHost
|
import li.cil.oc.api.driver.EnvironmentHost
|
||||||
import li.cil.oc.api.machine.Arguments
|
import li.cil.oc.api.machine.Arguments
|
||||||
import li.cil.oc.api.machine.Callback
|
import li.cil.oc.api.machine.Callback
|
||||||
@ -36,14 +37,16 @@ trait RedstoneBundled extends RedstoneVanilla {
|
|||||||
case (color, number: Number) => redstone.bundledOutput(side, color, number.intValue())
|
case (color, number: Number) => redstone.bundledOutput(side, color, number.intValue())
|
||||||
case _ =>
|
case _ =>
|
||||||
}
|
}
|
||||||
context.pause(0.1)
|
if (Settings.get.redstoneDelay > 0)
|
||||||
|
context.pause(Settings.get.redstoneDelay)
|
||||||
result(true)
|
result(true)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val color = checkColor(args, 1)
|
val color = checkColor(args, 1)
|
||||||
val value = args.checkInteger(2)
|
val value = args.checkInteger(2)
|
||||||
redstone.bundledOutput(side, color, value)
|
redstone.bundledOutput(side, color, value)
|
||||||
context.pause(0.1)
|
if (Settings.get.redstoneDelay > 0)
|
||||||
|
context.pause(Settings.get.redstoneDelay)
|
||||||
result(redstone.bundledOutput(side, color))
|
result(redstone.bundledOutput(side, color))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package li.cil.oc.server.component
|
package li.cil.oc.server.component
|
||||||
|
|
||||||
|
import li.cil.oc.Settings
|
||||||
import li.cil.oc.api.driver.EnvironmentHost
|
import li.cil.oc.api.driver.EnvironmentHost
|
||||||
import li.cil.oc.api.machine.Arguments
|
import li.cil.oc.api.machine.Arguments
|
||||||
import li.cil.oc.api.machine.Callback
|
import li.cil.oc.api.machine.Callback
|
||||||
@ -30,7 +31,8 @@ trait RedstoneVanilla extends RedstoneSignaller {
|
|||||||
val side = checkSide(args, 0)
|
val side = checkSide(args, 0)
|
||||||
val value = args.checkInteger(1)
|
val value = args.checkInteger(1)
|
||||||
redstone.output(side, value)
|
redstone.output(side, value)
|
||||||
context.pause(0.1)
|
if (Settings.get.redstoneDelay > 0)
|
||||||
|
context.pause(Settings.get.redstoneDelay)
|
||||||
result(redstone.output(side))
|
result(redstone.output(side))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import codechicken.lib.vec.Vector3
|
|||||||
import codechicken.wirelessredstone.core.WirelessReceivingDevice
|
import codechicken.wirelessredstone.core.WirelessReceivingDevice
|
||||||
import codechicken.wirelessredstone.core.WirelessTransmittingDevice
|
import codechicken.wirelessredstone.core.WirelessTransmittingDevice
|
||||||
import cpw.mods.fml.common.Optional
|
import cpw.mods.fml.common.Optional
|
||||||
|
import li.cil.oc.Settings
|
||||||
import li.cil.oc.api.driver.EnvironmentHost
|
import li.cil.oc.api.driver.EnvironmentHost
|
||||||
import li.cil.oc.api.machine.Arguments
|
import li.cil.oc.api.machine.Arguments
|
||||||
import li.cil.oc.api.machine.Callback
|
import li.cil.oc.api.machine.Callback
|
||||||
@ -48,7 +49,8 @@ trait RedstoneWireless extends RedstoneSignaller with WirelessReceivingDevice wi
|
|||||||
|
|
||||||
util.WirelessRedstone.updateOutput(this)
|
util.WirelessRedstone.updateOutput(this)
|
||||||
|
|
||||||
context.pause(0.1)
|
if (Settings.get.redstoneDelay > 0)
|
||||||
|
context.pause(Settings.get.redstoneDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
result(oldValue)
|
result(oldValue)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user