MC百科社群

标题: 现有一段自定义树生成代码如何改成根据群系生成而非种类 [打印本页]

作者: xiaohai43    时间: 2023-8-13 17:35
标题: 现有一段自定义树生成代码如何改成根据群系生成而非种类
  1. public class ModTreeGeneration {
  2.         public static void generateTrees(final BiomeLoadingEvent event) {
  3.                 ResourceKey<Biome> key = ResourceKey.create(Registry.BIOME_REGISTRY,event.getName());
  4.                 Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes(key);
  5.                 if(types.contains(BiomeDictionary.Type.BEACH)){
  6.                          List<Holder<PlacedFeature>> base = event.getGeneration().getFeatures(GenerationStep.Decoration.VEGETAL_DECORATION);
  7.                          base.add(ModPlacedFeatures.CHERRY_PLACED);
  8.              }
  9.       }
复制代码
如上,这段代码会根据生物群系的种类TYPES,如PLAINS,PEAK等生成,但是我想改成按照指定群戏生成,该怎么改
1.18.2forge40.1





欢迎光临 MC百科社群 (https://bbs.mcmod.cn/) MC百科|最大的MineCraft中文模组百科