Skip to content

Commit

Permalink
some structure fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HollowHorizon committed Feb 2, 2024
1 parent 7c84c4d commit 4892a49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 0 additions & 5 deletions src/main/java/ru/hollowhorizon/hollowengine/HollowEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import net.minecraftforge.fml.loading.FMLEnvironment
import ru.hollowhorizon.hc.HollowCore
import ru.hollowhorizon.hc.api.registy.HollowMod
import ru.hollowhorizon.hc.client.utils.mcText
import ru.hollowhorizon.hc.client.utils.rl
import ru.hollowhorizon.hc.common.registry.HollowModProcessor
import ru.hollowhorizon.hc.common.registry.RegistryLoader
import ru.hollowhorizon.hollowengine.client.ClientEvents
import ru.hollowhorizon.hollowengine.client.ClientEvents.initKeys
Expand All @@ -35,13 +33,10 @@ import ru.hollowhorizon.hollowengine.common.files.DirectoryManager
import ru.hollowhorizon.hollowengine.common.files.DirectoryManager.getModScripts
import ru.hollowhorizon.hollowengine.common.network.NetworkHandler
import ru.hollowhorizon.hollowengine.common.recipes.RecipeReloadListener
import ru.hollowhorizon.hollowengine.common.registry.worldgen.structures.ModBiomeTags
import ru.hollowhorizon.hollowengine.common.registry.worldgen.structures.ModStructurePieces
import ru.hollowhorizon.hollowengine.common.registry.worldgen.structures.ModStructureSets
import ru.hollowhorizon.hollowengine.common.registry.worldgen.structures.ModStructures
import ru.hollowhorizon.hollowengine.common.registry.worldgen.structures.ModStructures.createSettings
import ru.hollowhorizon.hollowengine.common.scripting.mod.runModScript
import ru.hollowhorizon.hollowengine.common.structures.ScriptedStructure
import thedarkcolour.kotlinforforge.forge.MOD_BUS

@HollowMod(HollowEngine.MODID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ import kotlin.random.Random
val STRUCTURES = HashMap<ResourceLocation, StructureContainer>()

class StructureContainer {
val settings: SpawnSettings = SpawnSettings { true }
var settings: SpawnSettings = SpawnSettings { true }
var spawnMode = SpawnMode.SURFACE
var yOffset = 0
val minSizeY = 10
var minSizeY = 10
}

fun interface SpawnSettings {
fun check(context: Structure.GenerationContext): Boolean
}

fun SpawnSettings.and(other: SpawnSettings) = SpawnSettings {
infix fun SpawnSettings.and(other: SpawnSettings) = SpawnSettings {
this@and.check(it) && other.check(it)
}

fun SpawnSettings.or(other: SpawnSettings) = SpawnSettings {
infix fun SpawnSettings.or(other: SpawnSettings) = SpawnSettings {
this@or.check(it) || other.check(it)
}

Expand Down

0 comments on commit 4892a49

Please sign in to comment.