高度与建筑限高
基本信息
| 属性 | 值 |
|---|---|
| 最低支持 Y | Integer.MIN_VALUE + 4096 = −2147479552 |
| 最高支持 Y | Integer.MAX_VALUE - 4095 = 2147479552 |
| 默认最小高度 | 0(配置键 cubicchunks.config.default_min_height) |
| 默认最大高度 | 1 << 30 = 1073741824(配置键 cubicchunks.config.default_max_height) |
| 按维度覆盖 | dimensional_height_overrides,默认 {"0:bottom:-64"} |
| 服务器限高设置时机 | FMLServerAboutToStartEvent |
| 触底提示 | cubicchunks.build.too.low = Minimum building depth reached |
功能
CubicChunks 把立方体 Y 范围(编译期常量)和世界实际高度(玩家可配置)分成两层:
- 立方体 Y 范围是硬边界
MIN_SUPPORTED_BLOCK_Y/MAX_SUPPORTED_BLOCK_Y(CubicChunks.java:95-96),任何配置都不能突破。 - 世界实际高度由
defaultMinHeight/defaultMaxHeight决定(CubicChunksConfig.java:123,128),并可被dimensional_height_overrides按维度覆盖(CubicChunksConfig.java:77)。
服务器启动前,主类的 onServerAboutToStart 把服务器的建造上限/下限设到立方体绝对边界(CubicChunks.java:194-201):
- 服务端:
server.setBuildLimit(CubicChunks.MAX_SUPPORTED_BLOCK_Y)+((ICubicChunksServer) server).setBuildMinimum(CubicChunks.MIN_SUPPORTED_BLOCK_Y)(:197-198) - 客户端:显式写为
// no-op, done by mixin(:199-200),由 mixin 侧处理
配置读取时 validateConfigValues() 会强制把非 16 倍数的高度向 0 取整并打错误日志(CubicChunksConfig.java:173-188);按维度覆盖解析时同样对每条 top/bottom 高度做 16 对齐(CubicChunksConfig.java:202-208),格式非法则抛 ConfigException(:195-197、:242-244)。
玩家在最低建筑深度放方块时,服务器回一条本地化消息 cubicchunks.build.too.low(语言键见 en_US.lang:39,英文为 Minimum building depth reached;注入点为 mixin/early/common/MixinNetHandlerPlayServer.java:43)。
数值
| 数值名 | 值 | 来源 |
|---|---|---|
| 最低支持 Y | −2147479552 | CubicChunks.java:95 |
| 最高支持 Y | 2147479552 | CubicChunks.java:96 |
defaultMinHeight 默认 |
0 | CubicChunksConfig.java:123 |
defaultMinHeight 取值范围 |
MIN_SUPPORTED_BLOCK_Y ~ 0 |
CubicChunksConfig.java:122 |
defaultMaxHeight 默认 |
1073741824(1 << 30) |
CubicChunksConfig.java:128 |
defaultMaxHeight 取值范围 |
16 ~ MAX_SUPPORTED_BLOCK_Y |
CubicChunksConfig.java:127 |
| 维度高度覆盖默认 | 0:bottom:-64 |
CubicChunksConfig.java:77 |
| 对齐粒度 | 16 | CubicChunksConfig.java:174,181,202 |
dimensional_height_overrides 每条格式为 dimensionId:top|bottom:height,方向只接受 top、bottom(CubicChunksConfig.java:213-229)。配置注释给出的示例为 0:bottom:-128 与 0:top:1024(CubicChunksConfig.java:74-75)。
交互
| 触发 | 行为 |
|---|---|
| 服务器启动 | 按立方体绝对边界设置建造上下限(CubicChunks.java:194-201) |
| 在低于最小建筑深度的位置放置方块 | 拒绝并提示 Minimum building depth reached |
修改 default_min_height / default_max_height |
新世界生效;已有世界按各自创建时的格式与高度继续 |
| 写入非 16 倍数高度 | 启动时自动向下取整到 16 倍数并记录错误 |
相关条目
- 立方区块与列结构 - Y 方向立方体的存储单位
- 配置文件 - 全部 18 个配置键
- Vanilla + Cubic 世界类型 - 生成范围跟随
getActualHeight()