Gui List Biomes Entry

基本信息

属性 值
类 com.chaosthedude.naturescompass.gui.GuiListBiomesEntry
仅客户端 @SideOnly(Side.CLIENT)
实现 GuiListExtended.IGuiListEntry

行为

列表项渲染和点击逻辑。

绘制

  • 第一行:群系名(白色)
  • 第二行:<sortingCategory.getLocalizedName()>: <getValue(biome)>(灰);若 getValue() == null(CategoryName),降级显示 Climate: <BiomeUtils.getBiomeClimate(biome)>
  • 第三行:Precipitation: <Snow/Rain/None>(灰)

点击

  • 单击 → biomesList.selectBiome(slotIndex)
  • 双击(250 ms 内)→ selectBiome() 播放按钮音,调用 guiNaturesCompass.searchForBiome(biome.biomeID)(即发 PacketCompassSearch)

数值

数值 默认值
双击间隔阈值 250 ms
文本主色 0xFFFFFF
文本次色 0x808080
第一行 Y 偏移 1
第二行 Y 偏移 FONT_HEIGHT + 3
第三行 Y 偏移 FONT_HEIGHT + 14

限制

  • 双击 250 ms 阈值在客户端卡顿时容易误触发为两次单击。
  • CategoryName 的 getValue() == null 是把 Climate 当兜底显示用的硬编码 hack。

相关条目