TGenerationLogic / TWorldGenerator

基本信息

属性 值
路径 mrtjp.core.world.genlogic
源码 src/main/scala/mrtjp/core/world/genlogic.scala

世界生成的过滤逻辑框架:TGenerationLogic 负责「该不该在这里生成」, TWorldGenerator 提供安全放置工具。

TGenerationLogic(extends ISimpleStructureGen)

可配置字段 默认值 语义
name "" 即 genID
dimensionBlacklist true true=黑名单,false=白名单
dimensions Set(-1, 1) 下界 / 上界
biomeBlacklist true 同上
biomes Set[Set[BiomeDictionary.Type]]() 生态集合
typeBlacklist true 同上
types Set(WorldType.FLAT) 世界类型
resistance 0 抗性:<=1 必过;>1 时按 1/resistance 概率通过
allowRetroGen false 是否允许追溯生成

过滤顺序

  1. isRetro && !allowRetroGen → 拒绝
  2. 维度黑/白名单
  3. 世界类型黑/白名单
  4. resistance > 1 && rand.nextInt(resistance) != 0 → 拒绝
  5. (generate 成功后)postFiltCheck 再查生态黑/白名单

注意:第 5 步在 generate_impl 之后才执行,即生态判定不阻止结构放置, 只影响返回值。属逻辑次序瑕疵。

TWorldGenerator

方法 说明
canSetBlock(w, x, y, z, material: Set[(Block, Int)]) 校验目标方块是否可被替换;meta = -1 表示忽略 metadata
setBlock(...) 安全放置

相关条目