BYG-Integration compile fixes
This commit is contained in:
parent
016a3048bd
commit
6a8ad29a70
4 changed files with 166 additions and 139 deletions
|
@ -1,5 +1,6 @@
|
||||||
package ru.betterend.integration.byg.biomes;
|
package ru.betterend.integration.byg.biomes;
|
||||||
|
|
||||||
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.registry.EndBiomes;
|
import ru.betterend.registry.EndBiomes;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
|
@ -11,7 +12,7 @@ public class BYGBiomes {
|
||||||
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
|
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
|
||||||
|
|
||||||
public static void register() {
|
public static void register() {
|
||||||
System.out.println("Registered " + OLD_BULBIS_GARDENS);
|
BetterEnd.LOGGER.info("Registered " + OLD_BULBIS_GARDENS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addBiomes() {
|
public static void addBiomes() {
|
||||||
|
|
|
@ -1,69 +1,84 @@
|
||||||
package ru.betterend.integration.byg.biomes;
|
package ru.betterend.integration.byg.biomes;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
import net.minecraft.world.entity.MobCategory;
|
import net.minecraft.world.entity.MobCategory;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||||
import ru.bclib.BCLib;
|
import ru.bclib.BCLib;
|
||||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||||
import ru.betterend.BetterEnd;
|
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
|
|
||||||
import java.util.List;
|
public class NightshadeRedwoods extends EndBiome.Config {
|
||||||
|
public NightshadeRedwoods() {
|
||||||
|
super("nightshade_redwoods");
|
||||||
|
}
|
||||||
|
|
||||||
public class NightshadeRedwoods extends EndBiome {
|
@Override
|
||||||
public NightshadeRedwoods() {
|
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||||
super(makeDef());
|
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
||||||
}
|
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||||
|
|
||||||
private static BCLBiomeDef makeDef() {
|
builder.fogColor(140, 108, 47)
|
||||||
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
|
.fogDensity(1.5F)
|
||||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
.waterAndFogColor(55, 70, 186)
|
||||||
|
.foliageColor(122, 17, 155)
|
||||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods")).setFogColor(140, 108, 47)
|
.particles(
|
||||||
.setFogDensity(1.5F)
|
ParticleTypes.REVERSE_PORTAL,
|
||||||
.setWaterAndFogColor(55, 70, 186)
|
0.002F
|
||||||
.setFoliageColor(122, 17, 155)
|
)
|
||||||
.setParticles(
|
//TODO: 1.18 surface rules
|
||||||
ParticleTypes.REVERSE_PORTAL,
|
// .setSurface(biome.getGenerationSettings()
|
||||||
0.002F
|
// .getSurfaceBuilder()
|
||||||
)
|
// .get())
|
||||||
.setSurface(biome.getGenerationSettings()
|
.grassColor(48, 13, 89)
|
||||||
.getSurfaceBuilder()
|
.plantsColor(200, 125, 9)
|
||||||
.get())
|
.feature(EndFeatures.END_LAKE_RARE)
|
||||||
.setGrassColor(48, 13, 89)
|
.feature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
||||||
.setPlantsColor(200, 125, 9)
|
.feature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
||||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
.feature(BYGFeatures.NIGHTSHADE_MOSS);
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
|
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
|
if (BCLib.isClient()) {
|
||||||
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
|
SoundEvent loop = effects.getAmbientLoopSoundEvent()
|
||||||
|
.get();
|
||||||
if (BCLib.isClient()) {
|
SoundEvent music = effects.getBackgroundMusic()
|
||||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
.get()
|
||||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
.getEvent();
|
||||||
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent();
|
SoundEvent additions = effects.getAmbientAdditionsSettings()
|
||||||
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
|
.get()
|
||||||
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
|
.getSoundEvent();
|
||||||
}
|
SoundEvent mood = effects.getAmbientMoodSettings()
|
||||||
biome.getGenerationSettings().features().forEach((list) -> {
|
.get()
|
||||||
list.forEach((feature) -> {
|
.getSoundEvent();
|
||||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature.get());
|
builder.loop(loop)
|
||||||
});
|
.music(music)
|
||||||
});
|
.additions(additions)
|
||||||
|
.mood(mood);
|
||||||
for (MobCategory group : MobCategory.values()) {
|
}
|
||||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
biome.getGenerationSettings()
|
||||||
list.forEach((entry) -> {
|
.features()
|
||||||
def.addMobSpawn(entry);
|
.forEach((list) -> {
|
||||||
});
|
list.forEach((feature) -> {
|
||||||
}
|
builder.feature(Decoration.VEGETAL_DECORATION, feature.get());
|
||||||
|
});
|
||||||
return def;
|
});
|
||||||
}
|
|
||||||
|
for (MobCategory group : MobCategory.values()) {
|
||||||
|
List<SpawnerData> list = biome.getMobSettings()
|
||||||
|
.getMobs(group)
|
||||||
|
.unwrap();
|
||||||
|
list.forEach((entry) -> {
|
||||||
|
builder.spawn((EntityType<? extends Mob>) entry.type, 1, entry.minCount, entry.maxCount);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,107 +1,117 @@
|
||||||
package ru.betterend.integration.byg.biomes;
|
package ru.betterend.integration.byg.biomes;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import net.minecraft.core.particles.ParticleTypes;
|
import net.minecraft.core.particles.ParticleTypes;
|
||||||
import net.minecraft.data.BuiltinRegistries;
|
import net.minecraft.data.BuiltinRegistries;
|
||||||
import net.minecraft.data.worldgen.Features;
|
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
|
import net.minecraft.world.entity.EntityType;
|
||||||
|
import net.minecraft.world.entity.Mob;
|
||||||
import net.minecraft.world.entity.MobCategory;
|
import net.minecraft.world.entity.MobCategory;
|
||||||
import net.minecraft.world.level.biome.Biome;
|
import net.minecraft.world.level.biome.Biome;
|
||||||
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
import net.minecraft.world.level.biome.BiomeSpecialEffects;
|
||||||
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
|
||||||
import net.minecraft.world.level.block.Block;
|
import net.minecraft.world.level.block.Block;
|
||||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||||
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
|
|
||||||
import ru.bclib.BCLib;
|
import ru.bclib.BCLib;
|
||||||
import ru.bclib.world.biomes.BCLBiomeDef;
|
import ru.bclib.api.biomes.BCLBiomeBuilder;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||||
import ru.betterend.registry.EndFeatures;
|
import ru.betterend.registry.EndFeatures;
|
||||||
import ru.betterend.world.biome.EndBiome;
|
import ru.betterend.world.biome.EndBiome;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.function.Supplier;
|
|
||||||
|
|
||||||
class FeaturesAccesor extends Features {
|
public class OldBulbisGardens extends EndBiome.Config {
|
||||||
static ConfiguredDecorator<?> shadowHEIGHTMAP_SQUARE;
|
public OldBulbisGardens() {
|
||||||
|
super("old_bulbis_gardens");
|
||||||
static {
|
}
|
||||||
shadowHEIGHTMAP_SQUARE = Decorators.HEIGHTMAP_SQUARE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class OldBulbisGardens extends EndBiome {
|
@Override
|
||||||
public OldBulbisGardens() {
|
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||||
super(makeDef());
|
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
|
||||||
}
|
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
||||||
|
|
||||||
private static BCLBiomeDef makeDef() {
|
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||||
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
|
// Block origin = biome.getGenerationSettings()
|
||||||
BiomeSpecialEffects effects = biome.getSpecialEffects();
|
// .getSurfaceBuilderConfig()
|
||||||
|
// .getTopMaterial()
|
||||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
// .getBlock();
|
||||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
builder.fogColor(215, 132, 207)
|
||||||
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens")).setFogColor(215, 132, 207)
|
.fogDensity(1.8F)
|
||||||
.setFogDensity(1.8F)
|
.waterAndFogColor(40, 0, 56)
|
||||||
.setWaterAndFogColor(40, 0, 56)
|
.foliageColor(122, 17, 155)
|
||||||
.setFoliageColor(122, 17, 155)
|
.particles(
|
||||||
.setParticles(
|
ParticleTypes.REVERSE_PORTAL,
|
||||||
ParticleTypes.REVERSE_PORTAL,
|
0.002F
|
||||||
0.002F
|
)
|
||||||
)
|
//TODO: 1.18 surface rules
|
||||||
.setSurface(ivis, origin)
|
//.surface(ivis, origin)
|
||||||
.addFeature(EndFeatures.END_LAKE_RARE)
|
.feature(EndFeatures.END_LAKE_RARE)
|
||||||
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
|
.feature(BYGFeatures.OLD_BULBIS_TREE);
|
||||||
|
|
||||||
if (BCLib.isClient()) {
|
if (BCLib.isClient()) {
|
||||||
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
|
SoundEvent loop = effects.getAmbientLoopSoundEvent()
|
||||||
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
|
.get();
|
||||||
SoundEvent additions = effects.getAmbientAdditionsSettings().get().getSoundEvent();
|
SoundEvent music = effects.getBackgroundMusic()
|
||||||
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
|
.get()
|
||||||
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
|
.getEvent();
|
||||||
}
|
SoundEvent additions = effects.getAmbientAdditionsSettings()
|
||||||
|
.get()
|
||||||
for (MobCategory group : MobCategory.values()) {
|
.getSoundEvent();
|
||||||
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
|
SoundEvent mood = effects.getAmbientMoodSettings()
|
||||||
list.forEach((entry) -> {
|
.get()
|
||||||
def.addMobSpawn(entry);
|
.getSoundEvent();
|
||||||
});
|
builder.loop(loop)
|
||||||
}
|
.music(music)
|
||||||
|
.additions(additions)
|
||||||
List<List<Supplier<ConfiguredFeature<?, ?>>>> features = biome.getGenerationSettings().features();
|
.mood(mood);
|
||||||
List<Supplier<ConfiguredFeature<?, ?>>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
|
}
|
||||||
if (vegetal.size() > 2) {
|
|
||||||
Supplier<ConfiguredFeature<?, ?>> getter;
|
for (MobCategory group : MobCategory.values()) {
|
||||||
// Trees (first two features)
|
List<SpawnerData> list = biome.getMobSettings()
|
||||||
// I couldn't process them with conditions, so that's why they are hardcoded (paulevs)
|
.getMobs(group)
|
||||||
for (int i = 0; i < 2; i++) {
|
.unwrap();
|
||||||
getter = vegetal.get(i);
|
list.forEach((entry) -> {
|
||||||
ConfiguredFeature<?, ?> feature = getter.get();
|
builder.spawn((EntityType<? extends Mob>) entry.type, 1, entry.minCount, entry.maxCount);
|
||||||
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
|
});
|
||||||
feature = Registry.register(
|
}
|
||||||
BuiltinRegistries.CONFIGURED_FEATURE,
|
|
||||||
id,
|
List<List<Supplier<PlacedFeature>>> features = biome.getGenerationSettings()
|
||||||
feature.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
|
.features();
|
||||||
);
|
List<Supplier<PlacedFeature>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
|
||||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
|
if (vegetal.size() > 2) {
|
||||||
}
|
Supplier<PlacedFeature> getter;
|
||||||
// Grasses and other features
|
// Trees (first two features)
|
||||||
for (int i = 2; i < vegetal.size(); i++) {
|
// I couldn't process them with conditions, so that's why they are hardcoded (paulevs)
|
||||||
getter = vegetal.get(i);
|
for (int i = 0; i < 2; i++) {
|
||||||
ConfiguredFeature<?, ?> feature = getter.get();
|
getter = vegetal.get(i);
|
||||||
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
|
PlacedFeature feature = getter.get();
|
||||||
}
|
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
|
||||||
}
|
feature = Registry.register(
|
||||||
|
BuiltinRegistries.PLACED_FEATURE,
|
||||||
def.addFeature(EndFeatures.PURPLE_POLYPORE)
|
id,
|
||||||
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
|
//TODO: 1.18 Check if this is correct
|
||||||
.addFeature(BYGFeatures.IVIS_MOSS)
|
feature//.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
|
||||||
.addFeature(BYGFeatures.IVIS_VINE)
|
);
|
||||||
.addFeature(BYGFeatures.IVIS_SPROUT);
|
builder.feature(Decoration.VEGETAL_DECORATION, feature);
|
||||||
|
}
|
||||||
return def;
|
// Grasses and other features
|
||||||
}
|
for (int i = 2; i < vegetal.size(); i++) {
|
||||||
|
getter = vegetal.get(i);
|
||||||
|
PlacedFeature feature = getter.get();
|
||||||
|
builder.feature(Decoration.VEGETAL_DECORATION, feature);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
builder.feature(EndFeatures.PURPLE_POLYPORE)
|
||||||
|
.feature(BYGFeatures.IVIS_MOSS_WOOD)
|
||||||
|
.feature(BYGFeatures.IVIS_MOSS)
|
||||||
|
.feature(BYGFeatures.IVIS_VINE)
|
||||||
|
.feature(BYGFeatures.IVIS_SPROUT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,10 +124,11 @@ public class EndBiomes {
|
||||||
/**
|
/**
|
||||||
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
|
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
|
||||||
*
|
*
|
||||||
* @param biome - {@link EndBiome} instance
|
* @param biomeConfig - {@link EndBiome.Config} instance
|
||||||
* @return registered {@link EndBiome}
|
* @return registered {@link EndBiome}
|
||||||
*/
|
*/
|
||||||
public static EndBiome registerSubBiomeIntegration(EndBiome biome) {
|
public static EndBiome registerSubBiomeIntegration(EndBiome.Config biomeConfig) {
|
||||||
|
EndBiome biome = EndBiome.create(biomeConfig);
|
||||||
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
|
||||||
BiomeAPI.registerBiome(biome);
|
BiomeAPI.registerBiome(biome);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue