Skip to content

Commit

Permalink
Added Config for SprinkleBehaviour Range.
Browse files Browse the repository at this point in the history
  • Loading branch information
abrossimow committed Nov 3, 2024
1 parent fdfc8b9 commit f52c0fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.possible_triangle.sliceanddice.block.sprinkler

import com.possible_triangle.sliceanddice.config.Configs
import io.github.fabricators_of_create.porting_lib.fluids.FluidStack
import net.minecraft.core.BlockPos
import net.minecraft.core.Vec3i
Expand Down Expand Up @@ -50,9 +51,10 @@ fun interface SprinkleBehaviour {
fun act(range: Range, world: ServerLevel, fluidStack: FluidStack, random: RandomSource)

companion object {
val serverRange = Configs.SERVER.SPRINKLER_BLOCKRANGE.get()
private val BEHAVIOURS = arrayListOf<RegisteredBehaviour>()

private val DEFAULT_RANGE = Vec3i(5, 7, 5)
private val DEFAULT_RANGE = Vec3i(serverRange, 7, serverRange)

fun register(tag: TagKey<Fluid>, behaviour: SprinkleBehaviour, range: Vec3i = DEFAULT_RANGE) {
register({ it.fluid.`is`(tag) }, behaviour, range)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ class ServerConfig(builder: ForgeConfigSpec.Builder) {

val SPRINKLER_CAPACITY = builder.defineInRange("sprinkler.fluid_capacity", 300, 10, 2048)
val SPRINKLER_USAGE = builder.defineInRange("sprinkler.fluid_per_use", 100, 0, 2048)
val SPRINKLER_BLOCKRANGE = builder.defineInRange("sprinkler.blockrange", 5, 0, 16)

}

0 comments on commit f52c0fa

Please sign in to comment.