Biome, Structure and Feature fixes

This commit is contained in:
Frank 2022-04-03 23:45:19 +02:00
parent 0e1627958a
commit 4b550b9e69
3 changed files with 13 additions and 8 deletions

View file

@ -93,7 +93,7 @@ public class BiomeAPI {
public static final BCLBiome SOUL_SAND_VALLEY_BIOME = registerNetherBiome(getFromRegistry(Biomes.SOUL_SAND_VALLEY).value()); public static final BCLBiome SOUL_SAND_VALLEY_BIOME = registerNetherBiome(getFromRegistry(Biomes.SOUL_SAND_VALLEY).value());
public static final BCLBiome BASALT_DELTAS_BIOME = registerNetherBiome(getFromRegistry(Biomes.BASALT_DELTAS).value()); public static final BCLBiome BASALT_DELTAS_BIOME = registerNetherBiome(getFromRegistry(Biomes.BASALT_DELTAS).value());
public static final BCLBiome THE_END = registerEndLandBiome(getFromRegistry(Biomes.THE_END).value()); public static final BCLBiome THE_END = registerEndLandBiome(getFromRegistry(Biomes.THE_END));
public static final BCLBiome END_MIDLANDS = registerSubBiome(THE_END, getFromRegistry(Biomes.END_MIDLANDS).value(), 0.5F); public static final BCLBiome END_MIDLANDS = registerSubBiome(THE_END, getFromRegistry(Biomes.END_MIDLANDS).value(), 0.5F);
public static final BCLBiome END_HIGHLANDS = registerSubBiome(THE_END, getFromRegistry(Biomes.END_HIGHLANDS).value(), 0.5F); public static final BCLBiome END_HIGHLANDS = registerSubBiome(THE_END, getFromRegistry(Biomes.END_HIGHLANDS).value(), 0.5F);
@ -232,8 +232,8 @@ public class BiomeAPI {
* @param biome {@link BCLBiome} * @param biome {@link BCLBiome}
* @return {@link BCLBiome} * @return {@link BCLBiome}
*/ */
public static BCLBiome registerEndLandBiome(Biome biome) { public static BCLBiome registerEndLandBiome(Holder<Biome> biome) {
BCLBiome bclBiome = new BCLBiome(biome, null); BCLBiome bclBiome = new BCLBiome(biome.value(), null);
END_LAND_BIOME_PICKER.addBiome(bclBiome); END_LAND_BIOME_PICKER.addBiome(bclBiome);
registerBiome(bclBiome); registerBiome(bclBiome);
@ -247,8 +247,8 @@ public class BiomeAPI {
* @param genChance float generation chance. * @param genChance float generation chance.
* @return {@link BCLBiome} * @return {@link BCLBiome}
*/ */
public static BCLBiome registerEndLandBiome(Biome biome, float genChance) { public static BCLBiome registerEndLandBiome(Holder<Biome> biome, float genChance) {
BCLBiome bclBiome = new BCLBiome(biome, VanillaBiomeSettings.createVanilla().setGenChance(genChance).build()); BCLBiome bclBiome = new BCLBiome(biome.value(), VanillaBiomeSettings.createVanilla().setGenChance(genChance).build());
END_LAND_BIOME_PICKER.addBiome(bclBiome); END_LAND_BIOME_PICKER.addBiome(bclBiome);
registerBiome(bclBiome); registerBiome(bclBiome);
@ -423,7 +423,7 @@ public class BiomeAPI {
FabricBiomesData.END_LAND_BIOMES.forEach((key, weight) -> { FabricBiomesData.END_LAND_BIOMES.forEach((key, weight) -> {
if (!hasBiome(key.location())) { if (!hasBiome(key.location())) {
registerEndLandBiome(BuiltinRegistries.BIOME.get(key), weight); registerEndLandBiome(BuiltinRegistries.BIOME.getHolder(key).orElseThrow(), weight);
} }
}); });

View file

@ -61,6 +61,11 @@ public class BCLFeatureBuilder <FC extends FeatureConfiguration, F extends Featu
modifications.add(modifier); modifications.add(modifier);
return this; return this;
} }
public BCLFeatureBuilder modifier(List<PlacementModifier> modifiers) {
modifications.addAll(modifiers);
return this;
}
/** /**
* Generate feature in certain iterations (per chunk). * Generate feature in certain iterations (per chunk).

View file

@ -79,8 +79,8 @@ public abstract class ModIntegration {
return BuiltinRegistries.CONFIGURED_FEATURE.get(getID(name)); return BuiltinRegistries.CONFIGURED_FEATURE.get(getID(name));
} }
public Biome getBiome(String name) { public Holder<Biome> getBiome(String name) {
return BuiltinRegistries.BIOME.get(getID(name)); return BuiltinRegistries.BIOME.getHolder(getKey(name)).orElseThrow();
} }
public Class<?> getClass(String path) { public Class<?> getClass(String path) {