@@ -8,6 +8,7 @@ import dan200.computercraft.api.peripheral.GenericPeripheral
88import dan200.computercraft.api.peripheral.IComputerAccess
99import dan200.computercraft.api.peripheral.PeripheralType
1010import net.minecraft.resources.ResourceLocation
11+ import org.valkyrienskies.clockwork.ClockworkConfig
1112import org.valkyrienskies.clockwork.ClockworkMod.MOD_ID
1213import org.valkyrienskies.clockwork.ClockworkMod.getKelvin
1314import org.valkyrienskies.kelvin.api.DuctNodePos
@@ -53,6 +54,7 @@ object GasHeatSource: GenericPeripheral {
5354 @LuaFunction
5455 @JvmStatic
5556 fun pushGas (from : INodeBlockEntity , computer : IComputerAccess , toName : String , gasName : String , amount : Optional <Double >) {
57+ if (! ClockworkConfig .SERVER .cheatKelvinPeripheral) throw LuaException (" Cheat kelvin peripheral not enabled in config" )
5658 val origin = from.getDuctNodePosition()
5759 val end = getNodePosFromPeripheral(computer, toName)
5860 val gas = getGasOrThrow(gasName)
@@ -63,6 +65,7 @@ object GasHeatSource: GenericPeripheral {
6365 @LuaFunction
6466 @JvmStatic
6567 fun pullGas (to : INodeBlockEntity , computer : IComputerAccess , fromName : String , gasName : String , amount : Optional <Double >) {
68+ if (! ClockworkConfig .SERVER .cheatKelvinPeripheral) throw LuaException (" Cheat kelvin peripheral not enabled in config" )
6669 val end = to.getDuctNodePosition()
6770 val origin = getNodePosFromPeripheral(computer, fromName)
6871 val gas = getGasOrThrow(gasName)
@@ -73,6 +76,7 @@ object GasHeatSource: GenericPeripheral {
7376 @LuaFunction
7477 @JvmStatic
7578 fun pushTemperature (from : INodeBlockEntity , computer : IComputerAccess , toName : String , amount : Optional <Double >) {
79+ if (! ClockworkConfig .SERVER .cheatKelvinPeripheral) throw LuaException (" Cheat kelvin peripheral not enabled in config" )
7680 val origin = from.getDuctNodePosition()
7781 val end = getNodePosFromPeripheral(computer, toName)
7882
@@ -82,6 +86,7 @@ object GasHeatSource: GenericPeripheral {
8286 @LuaFunction
8387 @JvmStatic
8488 fun pullTemperature (to : INodeBlockEntity , computer : IComputerAccess , fromName : String , amount : Optional <Double >) {
89+ if (! ClockworkConfig .SERVER .cheatKelvinPeripheral) throw LuaException (" Cheat kelvin peripheral not enabled in config" )
8590 val end = to.getDuctNodePosition()
8691 val origin = getNodePosFromPeripheral(computer, fromName)
8792
0 commit comments