树木世界生成
基本信息
| 属性 | 值 |
|---|---|
| 世界生成器类 | mods.natura.worldgen.BaseTreeWorldgen |
| 注册位置 | Natura.init(Natura.java:117-118) |
| 注册权重 | 20 |
| 生成的树 / 植物种类 | 16 种生成器实例 |
| 群系开关位 | Natura.DIM_WORLDGEN_TREE_BIT = 4 |
功能
BaseTreeWorldgen 实现 IWorldGenerator,是 Natura 树木与大型植物的主要世界生成入口。构造函数中实例化 16 个生成器(worldgen/BaseTreeWorldgen.java:17-37):
| 生成器字段 | 生成器类 | 生成对象 |
|---|---|---|
genRedwood |
RedwoodTreeGen(false, NContent.redwood) |
红杉 |
genBlood |
BloodTreeLargeGen(3, 2) |
血木 |
bush |
BushTreeGen(false, 2, 3, 2) |
啤酒花树 |
pinkSakura |
SakuraTreeGen(false, 1, 0) |
粉樱花树 |
whiteSakura |
WhiteTreeGen(false, 2, 1) |
白樱花树 |
eucalyptusShort |
EucalyptusTreeGenShort(0, 1) |
小桉树 |
saguaro |
SaguaroGen(NContent.saguaro, 0, false) |
仙人掌 |
darkwood |
DarkwoodGen(false, 3, 0) |
暗木 |
fusewood |
FusewoodGen(false, 3, 1) |
熔木 |
maple |
RareTreeGen(false, 4, 2, 0, 0) |
枫树 |
silverbell |
RareTreeGen(false, 4, 2, 1, 1) |
银铃树 |
purpleheart |
RareTreeGen(false, 9, 8, 2, 2) |
紫心木 |
tiger |
RareTreeGen(false, 6, 4, 3, 3) |
虎纹木 |
willow |
WillowGen(false) |
柳木 |
blueGreenGlowshroom |
GlowshroomGenBlueGreen(false) |
绿/蓝发光蘑菇 |
purpleGlowshroom |
GlowshroomGenPurple(false) |
紫发光蘑菇 |
注意 RareTreeGen 被复用于 4 种树,仅参数不同(BaseTreeWorldgen.java:28-31)—— 第 2 个参数为最小高度、第 3 个为最大高度。
逐维度开关
generate 的第一件事是读取维度的世界生成位掩码(BaseTreeWorldgen.java:64-67):
int dimSettings = Natura.getDimensionWorldgenOverrides(world.provider.dimensionId);
if ((dimSettings & Natura.DIM_WORLDGEN_TREE_BIT) == 0) {
return;
}
三个生成器各占一位(Natura.java:105-107):
| 常量 | 值 | 生成器 |
|---|---|---|
DIM_WORLDGEN_CROP_BIT |
1 | 浆果丛 / 蓝铃花 |
DIM_WORLDGEN_CLOUD_BIT |
2 | 云 |
DIM_WORLDGEN_TREE_BIT |
4 | 树木 / 发光蘑菇 |
无覆写时 getDimensionWorldgenOverrides 返回 Integer.MAX_VALUE,即三个生成器全部启用(Natura.java:191-194)。
数值
| 数值名 | 值 | 来源 |
|---|---|---|
| 世界生成权重 | 20 | Natura.java:117 |
| 生成器实例数 | 16 | BaseTreeWorldgen.java:17-37 |
| 树生成位 | 4 | Natura.java:107 |
| 红杉生成稀有度 | 150(最高最难) | PHNatura.java:99 |
| 血木生成稀有度 | 14 | PHNatura.java:100 |
| 樱花生成稀有度 | 10 | PHNatura.java:103 |
| 鬼木生成稀有度 | 10 | PHNatura.java:105 |
| 啤酒花树稀有度 / 范围 | 10 / 20 | PHNatura.java:106-107 |
| 小桉树稀有度 / 范围 | 25 / 32 | PHNatura.java:101-102 |
| 紫心木稀有度 | 1(最高最常见) | PHNatura.java:110 |
| 枫树稀有度 | 34 | PHNatura.java:111 |
| 虎纹木稀有度 | 30 | PHNatura.java:112 |
| 银铃树稀有度 | 70 | PHNatura.java:113 |
| 暗木稀有度 | 10 | PHNatura.java:115 |
| 熔木稀有度 | 50 | PHNatura.java:116 |
| 仙人掌稀有度 | 5 | PHNatura.java:118 |
| 荆棘藤稀有度 | 40 | PHNatura.java:151 |
稀有度数值含义为「每 N 格出现 1 次」,因此数值越大越稀有。 紫心木(1)最常见,银铃树(70)最稀有,红杉(150)极稀有。
群系限制
generate 读取当前群系名 biomeName(BaseTreeWorldgen.java:68-75),若为 null 直接返回。可见群系白名单包含:Forest、AutumnWoods、BirchForest、PineForest、Rainforest、TemperateRainforest 等(BaseTreeWorldgen.java:76-80 起)。
生成开关
以下开关位于 disabler 分类,全部默认 true(PHNatura.java:43-83):
Generate Redwood Trees、Generate Sakura Trees、Generate Small Eucalyptus Trees、Generate Hopseed Trees、Generate Bloodwood Trees、Generate Ghost Trees、Generate Saguaro Cactus、Generate Amaranth Trees、Generate Willow Trees、Generate Tigerwood Trees、Generate Silverbell Trees、Generate Maple Trees、Generate Darkwood Trees、Generate Fusewood Trees、Generate Thornvines、Generate Green Glowshroom、Generate Purple Glowshroom、Generate Blue Glowshroom、Generate Glowshroom Trees
追溯生成
retrogen(Natura.java:247)默认为 false,配置项为 Retrogen → Retroactive Generation(PHNatura.java:28)。启用后 WorldHandler(worldgen/retro/WorldHandler.java)会为已加载的区块补生成,并通过 ChunkDataEvent.Save 写入 Natura.Retrogen 标记(Natura.java:250-252),避免重复处理。
相关条目
- 作物世界生成 - 浆果丛与蓝铃花的生成
- 云世界生成 - 4 类云的生成
- 发光蘑菇 - 由本生成器负责的发光植物
- Natura 木材与树木 - 树种与原木的对应关系