Skip to content

Commit 4e978db

Browse files
committed
configurable duct volume
1 parent 4291e06 commit 4e978db

File tree

6 files changed

+26
-7
lines changed

6 files changed

+26
-7
lines changed

common/src/main/kotlin/org/valkyrienskies/clockwork/ClockworkConfig.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ object ClockworkConfig {
7070
@ConfigEntry(description = "Enable collision sound effects")
7171
var collisionSoundEffects = false
7272

73+
@ConfigEntry(description = "Duct-like volume. The volume used for ducts, valves, exhausts, etc.")
74+
var ductVolme = 0.4
75+
7376
@ConfigEntry(description = "Max collision events per tick. Dumps collision event queue if amount is bigger. Default is 100", min = 1.0)
7477
var collisionSoundEffectMax = 100
7578

common/src/main/kotlin/org/valkyrienskies/clockwork/content/logistics/gas/duct/DuctBlock.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class DuctBlock(properties: Properties) : Block(properties), INodeBlock, IDuct,
262262
}
263263

264264
override fun createNode(pos: DuctNodePos): DuctNode {
265-
return DuctPipeNode(pos = pos, volume = 0.25, maxPressure = 16375049.0, maxTemperature = 1478.0)
265+
return DuctPipeNode(pos = pos, volume = getInternalVolume(), maxPressure = 16375049.0, maxTemperature = 1478.0)
266266
}
267267

268268
override fun canBeReplaced(state: BlockState, fluid: Fluid): Boolean {
@@ -486,7 +486,7 @@ class DuctBlock(properties: Properties) : Block(properties), INodeBlock, IDuct,
486486
}
487487

488488
override fun getInternalVolume(): Double {
489-
return 0.25
489+
return ClockworkConfig.SERVER.ductVolme
490490
}
491491

492492
override fun getAdditionalInfoLines(): List<Component> {

common/src/main/kotlin/org/valkyrienskies/clockwork/content/logistics/gas/exhaust/ExhaustBlock.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import net.minecraft.world.level.block.state.StateDefinition
1919
import net.minecraft.world.phys.shapes.CollisionContext
2020
import net.minecraft.world.phys.shapes.VoxelShape
2121
import org.valkyrienskies.clockwork.ClockworkBlockEntities
22+
import org.valkyrienskies.clockwork.ClockworkConfig
2223
import org.valkyrienskies.clockwork.ClockworkShapes
2324
import org.valkyrienskies.clockwork.content.logistics.gas.duct.DuctPipeNode
2425
import org.valkyrienskies.clockwork.content.logistics.gas.duct.IDuct
@@ -81,7 +82,7 @@ class ExhaustBlock(properties: Properties) : DirectionalBlock(properties), IBE<E
8182
}
8283

8384
override fun createNode(pos: DuctNodePos): DuctNode {
84-
return DuctPipeNode(pos = pos, volume = 0.25, maxPressure = 16375049.0, maxTemperature = 1478.0)
85+
return DuctPipeNode(pos = pos, volume = ClockworkConfig.SERVER.ductVolme, maxPressure = 16375049.0, maxTemperature = 1478.0)
8586
}
8687

8788
override fun onRemove(state: BlockState, level: Level, pos: BlockPos, newState: BlockState, movedByPiston: Boolean) {

common/src/main/kotlin/org/valkyrienskies/clockwork/content/logistics/gas/pump/PumpDuctBlock.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ import net.minecraft.world.level.material.Fluids
2121
import net.minecraft.world.phys.shapes.CollisionContext
2222
import net.minecraft.world.phys.shapes.VoxelShape
2323
import org.valkyrienskies.clockwork.ClockworkBlockEntities
24+
import org.valkyrienskies.clockwork.ClockworkConfig
2425
import org.valkyrienskies.clockwork.ClockworkMod
2526
import org.valkyrienskies.clockwork.content.logistics.gas.IConnectable
27+
import org.valkyrienskies.clockwork.content.logistics.gas.duct.DuctPipeNode
2628
import org.valkyrienskies.clockwork.util.gui.IHaveDuctStats
2729
import org.valkyrienskies.kelvin.KelvinMod
2830
import org.valkyrienskies.kelvin.api.DuctEdge
31+
import org.valkyrienskies.kelvin.api.DuctNode
2932
import org.valkyrienskies.kelvin.api.DuctNodePos
3033
import org.valkyrienskies.kelvin.api.edges.PumpDuctEdge
34+
import org.valkyrienskies.kelvin.api.nodes.PipeDuctNode
3135
import org.valkyrienskies.kelvin.util.IEdgeBlock
3236
import org.valkyrienskies.kelvin.util.INodeBlock
3337
import org.valkyrienskies.kelvin.util.INodeBlockEntity
@@ -105,10 +109,13 @@ class PumpDuctBlock(properties: Properties): DirectionalKineticBlock(properties)
105109
}
106110
}
107111

112+
override fun createNode(pos: DuctNodePos): DuctNode {
113+
return DuctPipeNode(pos = pos, volume = getInternalVolume(), maxPressure = 16375049.0, maxTemperature = 1478.0)
114+
}
108115

109116

110117
override fun getInternalVolume(): Double {
111-
return 0.0
118+
return ClockworkConfig.SERVER.ductVolme
112119
}
113120

114121
override fun getMaximumPressure(): Double {

common/src/main/kotlin/org/valkyrienskies/clockwork/content/logistics/gas/valve/ValveDuctBlock.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties
1818
import net.minecraft.world.phys.shapes.CollisionContext
1919
import net.minecraft.world.phys.shapes.VoxelShape
2020
import org.valkyrienskies.clockwork.ClockworkBlockEntities
21+
import org.valkyrienskies.clockwork.ClockworkConfig
22+
import org.valkyrienskies.clockwork.content.logistics.gas.duct.DuctPipeNode
2123
import org.valkyrienskies.clockwork.util.gui.IHaveDuctStats
24+
import org.valkyrienskies.kelvin.api.DuctNode
25+
import org.valkyrienskies.kelvin.api.DuctNodePos
2226
import org.valkyrienskies.kelvin.api.edges.ApertureDuctEdge
2327
import org.valkyrienskies.kelvin.util.INodeBlock
2428

@@ -73,8 +77,12 @@ class ValveDuctBlock(properties: Properties?) : DirectionalAxisKineticBlock(prop
7377
return ClockworkBlockEntities.VALVE_DUCT.get()
7478
}
7579

80+
override fun createNode(pos: DuctNodePos): DuctNode {
81+
return DuctPipeNode(pos = pos, volume = getInternalVolume(), maxPressure = 16375049.0, maxTemperature = 1478.0)
82+
}
83+
7684
override fun getInternalVolume(): Double {
77-
return 0.0
85+
return ClockworkConfig.SERVER.ductVolme
7886
}
7987

8088
override fun getMaximumPressure(): Double {

common/src/main/kotlin/org/valkyrienskies/clockwork/content/physicalities/gas_thruster/GasThrusterBlock.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class GasThrusterBlock(properties: Properties) : DirectionalBlock(properties), I
8888
}
8989

9090
override fun createNode(pos: DuctNodePos): DuctNode {
91-
return DuctPipeNode(pos = pos, volume = 0.25, maxPressure = 16375049.0, maxTemperature = 1478.0)
91+
return DuctPipeNode(pos = pos, volume = getInternalVolume(), maxPressure = 16375049.0, maxTemperature = 1478.0)
9292
}
9393

9494
override fun onRemove(
@@ -103,7 +103,7 @@ class GasThrusterBlock(properties: Properties) : DirectionalBlock(properties), I
103103
}
104104

105105
override fun getInternalVolume(): Double {
106-
return 0.25
106+
return 0.5
107107
}
108108

109109
override fun getBlockEntityClass(): Class<GasThrusterBlockEntity> {

0 commit comments

Comments
 (0)