Sort Categories
基本信息
| 属性 |
值 |
| 接口 |
com.chaosthedude.naturescompass.sorting.ISortingCategory |
| 实现数 |
6 |
| 调用方 |
GuiNaturesCompass(点击 sortByButton 轮转 sortingCategory.next()) |
行为
ISortingCategory 扩展 Comparator<BiomeGenBase>,每个实现定义一种群系排序维度,next() 指向下一种(形成单向环)。GuiNaturesCompass.sortBiomes() 先按 CategoryName 排序再用 sortingCategory 排序。
6 种排序维度
| 类 |
排序字段 |
getValue() |
显示名(i18n) |
CategoryName |
BiomeUtils.getBiomeName(biome) |
null |
string.naturescompass.name |
CategoryBaseHeight |
biome.rootHeight |
biome.rootHeight |
string.naturescompass.baseHeight |
CategoryHeightVariation |
biome.heightVariation |
biome.heightVariation |
string.naturescompass.heightVariation |
CategoryTemperature |
biome.temperature |
biome.temperature |
string.naturescompass.temperature |
CategoryRainfall |
biome.rainfall |
biome.rainfall |
string.naturescompass.rainfall |
CategoryTags |
BiomeUtils.getBiomeTags(biome)(BiomeDictionary 拼接串) |
同左 |
string.naturescompass.tags |
切换环
CategoryName → CategoryBaseHeight → CategoryHeightVariation
→ CategoryTemperature → CategoryRainfall
→ CategoryTags → CategoryName
数值
| 数值 |
默认值 |
| 默认起始排序 |
CategoryName |
| 排序顺序(每次 sortBiomes) |
先 CategoryName,再当前 sortingCategory |
限制
CategoryName.getValue() 返回 null,GuiListBiomesEntry.drawEntry() 检测到 value == null 时降级使用 BiomeUtils.getBiomeClimate(biome) 作为显示值。
next() 链路是硬编码,没有注册表,删一个实现就 break 循环。
第三方 mod 集成
BiomeDictionary.getTypesForBiome(biome) 来自 MinecraftForge API,用于把群系分类 tag(如 HOT, DENSE, NETHER 等)转成排序键。
相关条目