Это такой ResourceLocation, который служит удобным идентификатором регистрируемым объектамregistryc name
@Mod.EventBusSubscriber(modid = PetyasMod.MODID)
public class IronOre {
private static ConfiguredFeature oreConfiguredFeature;
private static ConfiguredFeature oreConfiguredFeature() {
if (oreConfiguredFeature == null) {
oreConfiguredFeature = new OreFeature(OreFeatureConfig::deserialize) {
@Override
public boolean place(IWorld worldIn, ChunkGenerator generator, Random rand, BlockPos pos, OreFeatureConfig config) {
if(rand.nextInt(64) == 2)
return super.place(worldIn, generator, rand, pos, config);
else
return false;
}
}.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, Blocks.IRON_ORE.getDefaultState(), 128))
.withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(1, 0, 0, 120)));
}
return oreConfiguredFeature;
}
@SubscribeEvent
public static void registerOreAtBiomes(FMLCommonSetupEvent event) {
for(Biome biome : ForgeRegistries.BIOMES)
if (!biome.getCategory().equals(Biome.Category.NETHER) && !biome.getCategory().equals(Biome.Category.THEEND)) {
biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, oreConfiguredFeature());
}
}
}
Вот эта штука добавляет твою фичу куда-то в кишки биома. Нужно посмотреть куда, залезть туда и удалить ванильную фичу рудыbiome.addFeature
public static void addOres(Biome biomeIn) {
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, COAL_ORE, 17)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(20, 0, 0, 128))));
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, IRON_ORE, 9)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(20, 0, 0, 64))));
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, GOLD_ORE, 9)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(2, 0, 0, 32))));
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, REDSTONE_ORE, 8)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(8, 0, 0, 16))));
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, DIAMOND_ORE, 8)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(1, 0, 0, 16))));
biomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, LAPIS_ORE, 7)).withPlacement(Placement.COUNT_DEPTH_AVERAGE.configure(new DepthAverageConfig(1, 16, 16))));
}
protected final Map<GenerationStage.Decoration, List<ConfiguredFeature<?, ?>>> features = Maps.newHashMap();
Очевидно, это нужно делать после того, как в ней появятся ванильные фичи. Например, в обработчике события FMLCommonSetupEvent с низшим приоритетом.И откуда?
Как её теперь изменять?
Типо, берем из мапы список на ключу UNDERGROUND_ORES и в нем ищем фичу для удаленияbiomeIn.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, COAL_ORE, 17)).withPlacement(Placement.COUNT_RANGE.configure(new CountRangeConfig(20, 0, 0, 128))));