Biome, Structure and Feature fixes

This commit is contained in:
Frank 2022-04-03 23:45:18 +02:00
parent bcde62209b
commit 1cdbcacd7b
45 changed files with 112 additions and 99 deletions

View file

@ -1,5 +1,6 @@
package ru.betterend.integration;
import net.minecraft.core.Holder;
import net.minecraft.core.MappedRegistry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
@ -22,7 +23,7 @@ public class EnderscapeIntegration extends ModIntegration {
MappedRegistry<?> biomes = getStaticFieldValue(enderscape, "ENDERSCAPE_BIOME");
biomes.entrySet().forEach(entry -> {
ResourceKey key = entry.getKey();
Biome biome = getBiome(key.location().getPath());
Holder<Biome> biome = getBiome(key.location().getPath());
if (enderscapeIslandsBiome.isInstance(entry.getValue())) {
BiomeAPI.registerEndVoidBiome(biome);
}

View file

@ -1,5 +1,6 @@
package ru.betterend.integration.byg.biomes;
import net.minecraft.core.Holder;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.EntityType;
@ -25,8 +26,8 @@ public class NightshadeRedwoods extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
BiomeSpecialEffects effects = biome.getSpecialEffects();
Holder<Biome> biome = Integrations.BYG.getBiome("nightshade_forest");
BiomeSpecialEffects effects = biome.value().getSpecialEffects();
builder.fogColor(140, 108, 47)
.fogDensity(1.5F)
@ -64,16 +65,17 @@ public class NightshadeRedwoods extends EndBiome.Config {
.additions(additions)
.mood(mood);
}
biome.getGenerationSettings()
biome.value().getGenerationSettings()
.features()
.forEach((list) -> {
list.forEach((feature) -> {
builder.feature(Decoration.VEGETAL_DECORATION, feature.get());
builder.feature(Decoration.VEGETAL_DECORATION, feature);
});
});
for (MobCategory group : MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings()
List<SpawnerData> list = biome.value()
.getMobSettings()
.getMobs(group)
.unwrap();
list.forEach((entry) -> {

View file

@ -1,5 +1,7 @@
package ru.betterend.integration.byg.biomes;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderSet;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.BuiltinRegistries;
@ -33,8 +35,8 @@ public class OldBulbisGardens extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
BiomeSpecialEffects effects = biome.getSpecialEffects();
Holder<Biome> biome = Integrations.BYG.getBiome("bulbis_gardens");
BiomeSpecialEffects effects = biome.value().getSpecialEffects();
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
// Block origin = biome.getGenerationSettings()
@ -81,29 +83,28 @@ public class OldBulbisGardens extends EndBiome.Config {
});
}
List<List<Supplier<PlacedFeature>>> features = biome.getGenerationSettings()
List<HolderSet<PlacedFeature>> features = biome.getGenerationSettings()
.features();
List<Supplier<PlacedFeature>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
HolderSet<PlacedFeature> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
if (vegetal.size() > 2) {
Supplier<PlacedFeature> getter;
// Trees (first two features)
// I couldn't process them with conditions, so that's why they are hardcoded (paulevs)
for (int i = 0; i < 2; i++) {
getter = vegetal.get(i);
PlacedFeature feature = getter.get();
Holder<PlacedFeature> feature = getter.get();
ResourceLocation id = BetterEnd.makeID("obg_feature_" + i);
feature = Registry.register(
BuiltinRegistries.PLACED_FEATURE,
id,
//TODO: 1.18 Check if this is correct
feature//.decorated(FeaturesAccesor.shadowHEIGHTMAP_SQUARE).countRandom(1)
feature
);
builder.feature(Decoration.VEGETAL_DECORATION, feature);
}
// Grasses and other features
for (int i = 2; i < vegetal.size(); i++) {
getter = vegetal.get(i);
PlacedFeature feature = getter.get();
Holder<PlacedFeature> feature = getter.get();
builder.feature(Decoration.VEGETAL_DECORATION, feature);
}
}

View file

@ -2,6 +2,7 @@ package ru.betterend.integration.byg.features;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import ru.bclib.api.features.BCLCommonFeatures;
import ru.bclib.world.features.BCLFeature;
import ru.betterend.BetterEnd;
import ru.betterend.integration.Integrations;
@ -59,6 +60,6 @@ public class BYGFeatures {
}
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
return BCLCommonFeatures.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
}
}

View file

@ -1,9 +0,0 @@
package ru.betterend.interfaces;
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
import net.minecraft.world.level.levelgen.feature.StructureFeature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
public interface StructureFeaturesAccessor {
ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> getEndCity();
}

View file

@ -86,7 +86,7 @@ public abstract class MusicTrackerMixin {
if (minecraft.level == null) {
return false;
}
return BiomeAPI.getRenderBiome(minecraft.level.getBiome(minecraft.player.blockPosition())) instanceof EndBiome;
return BiomeAPI.getRenderBiome(minecraft.level.getBiome(minecraft.player.blockPosition()).value()) instanceof EndBiome;
}
private boolean be_shouldChangeSound(Music musicSound) {

View file

@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.pattern.BlockPattern;
import net.minecraft.world.level.dimension.end.DragonRespawnAnimation;
import net.minecraft.world.level.dimension.end.EndDragonFight;
import net.minecraft.world.phys.AABB;
import org.apache.logging.log4j.Logger;
import org.slf4j.Logger;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@ -30,9 +30,7 @@ public class EndDragonFightMixin {
private boolean dragonKilled;
@Shadow
private BlockPos portalLocation;
@Final
@Shadow
private static Logger LOGGER;
@Shadow @Final private static Logger LOGGER;
@Final
@Shadow
private ServerLevel level;

View file

@ -2,6 +2,7 @@ package ru.betterend.mixin.common;
import com.mojang.authlib.GameProfile;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket;
import net.minecraft.network.protocol.game.ClientboundLevelEventPacket;
import net.minecraft.network.protocol.game.ClientboundPlayerAbilitiesPacket;
@ -89,7 +90,7 @@ public abstract class ServerPlayerMixin extends Player implements TeleportingEnt
LevelData worldProperties = destination.getLevelData();
ServerPlayer player = ServerPlayer.class.cast(this);
connection.send(new ClientboundRespawnPacket(
destination.dimensionType(),
new Holder.Direct(destination.dimensionType()),
destination.dimension(),
BiomeManager.obfuscateSeed(destination.getSeed()),
gameMode.getGameModeForPlayer(),

View file

@ -1,19 +0,0 @@
package ru.betterend.mixin.common;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
import net.minecraft.world.level.levelgen.feature.StructureFeature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import ru.betterend.interfaces.StructureFeaturesAccessor;
@Mixin(StructureFeatures.class)
public class StructureFeaturesMixin implements StructureFeaturesAccessor {
@Shadow @Final private static ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> END_CITY;
public ConfiguredStructureFeature<NoneFeatureConfiguration, ? extends StructureFeature<NoneFeatureConfiguration>> getEndCity(){
return END_CITY;
}
}

View file

@ -3,6 +3,7 @@ package ru.betterend.registry;
import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
@ -304,15 +305,21 @@ public class EndFeatures {
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
//PlacedFeature configured = layer.configured(FeatureConfiguration.NONE).placed(new PlacementModifier[]{CountPlacement.of(count)});
// return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
return BCLFeatureBuilder
.start(BetterEnd.makeID(name), layer)
.decoration( GenerationStep.Decoration.UNDERGROUND_ORES)
.modifier(CountPlacement.of(count))
.build();
}
private static BCLFeature registerLayer(String name, StoneMaterial material, float radius, int minY, int maxY, int count) {
return registerLayer(name, material.stone, radius, minY, maxY, count);
}
public static void addBiomeFeatures(ResourceLocation id, Biome biome) {
public static void addBiomeFeatures(ResourceLocation id, Holder<Biome> biome) {
BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
@ -345,7 +352,12 @@ public class EndFeatures {
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
Feature<?> feature = Registry.FEATURE.get(id);
return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
//return new BCLFeature(id, feature, Decoration.SURFACE_STRUCTURES, placed);
return BCLFeatureBuilder
.start(id, feature)
.decoration(Decoration.SURFACE_STRUCTURES)
.modifier(placed.placement())
.build(placed.feature().value().config());
}
String path = "/data/" + ns + "/structures/biome/" + nm + "/";

View file

@ -1,11 +1,13 @@
package ru.betterend.registry;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.tag.TagAPI;
import ru.bclib.world.structures.BCLStructureFeature;
import ru.betterend.BetterEnd;
import ru.betterend.world.structures.features.EternalPortalStructure;
@ -86,9 +88,9 @@ public class EndStructures {
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
}
public static void addBiomeStructures(ResourceLocation biomeID, Biome biome) {
public static void addBiomeStructures(ResourceLocation biomeID, Holder<Biome> biome) {
if (!biomeID.getPath().contains("mountain") && !biomeID.getPath().contains("lake")) {
BiomeAPI.addBiomeStructure(BiomeAPI.getBiomeKey(biome), ETERNAL_PORTAL);
TagAPI.addBiomeTag(ETERNAL_PORTAL.biomeTag, biome.value());
}
}
}

View file

@ -108,6 +108,7 @@ public class EndTags {
ITEM_HAMMERS.add(item);
}
});
ToolManagerImpl.tag(CommonItemTags.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(ITEM_HAMMERS));
TagAPI.addBlockTag(
@ -128,9 +129,9 @@ public class EndTags {
);
TagAPI.addItemTag(NamedCommonItemTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
TagAPI.addItemTag(ALLOYING_IRON.getName(), Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addItemTag(ALLOYING_GOLD.getName(), Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addItemTag(ALLOYING_COPPER.getName(), Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
TagAPI.addItemTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addItemTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addItemTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
}
public static void addEndGround(Block bl){

View file

@ -441,7 +441,7 @@ public class EternalRitual {
}
}
if (targetWorld.dimension() == Level.END) {
net.minecraft.data.worldgen.features.EndFeatures.END_ISLAND.place(
net.minecraft.data.worldgen.features.EndFeatures.END_ISLAND.value().place(
targetWorld,
targetWorld.getChunkSource().getGenerator(),
new Random(basePos.asLong()),
@ -453,6 +453,7 @@ public class EternalRitual {
}
EndFeatures.BIOME_ISLAND
.getPlacedFeature()
.value()
.place(targetWorld,
targetWorld.getChunkSource().getGenerator(),
new Random(basePos.asLong()),

View file

@ -3,6 +3,7 @@ package ru.betterend.util;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.FabricLootSupplierBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.minecraft.core.Holder;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.biome.Biome;
@ -92,8 +93,8 @@ public class LootTableUtil {
});
}
public static ResourceLocation getTable(Biome biome) {
BCLBiome bclBiome = BiomeAPI.getBiome(biome);
public static ResourceLocation getTable(Holder<Biome> biome) {
BCLBiome bclBiome = BiomeAPI.getBiome(biome.value());
if (bclBiome == EndBiomes.FOGGY_MUSHROOMLAND) {
return FOGGY_MUSHROOMLAND;
}

View file

@ -1,7 +1,6 @@
package ru.betterend.world.biome;
import net.minecraft.core.BlockPos;
import net.minecraft.data.worldgen.StructureFeatures;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.level.WorldGenLevel;
@ -17,7 +16,6 @@ import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiome;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.BetterEnd;
import ru.betterend.interfaces.StructureFeaturesAccessor;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds;
@ -64,7 +62,6 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
public abstract static class Config {
public static final SurfaceMaterialProvider DEFAULT_MATERIAL = new DefaultSurfaceMaterialProvider();
protected static final StructureFeaturesAccessor VANILLA_FEATURES = (StructureFeaturesAccessor)new StructureFeatures();
protected static final SurfaceRules.RuleSource END_STONE = SurfaceRules.state(DefaultSurfaceMaterialProvider.END_STONE);
protected static final SurfaceRules.RuleSource END_MOSS = SurfaceRules.state(EndBlocks.END_MOSS.defaultBlockState());
protected static final SurfaceRules.RuleSource ENDSTONE_DUST = SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState());

View file

@ -19,7 +19,7 @@ public class BiomeIceStarfield extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder.structure(EndStructures.GIANT_ICE_STAR.getFeatureConfigured())
builder.structure(EndStructures.GIANT_ICE_STAR)
.fogColor(224, 245, 254)
.temperature(0F)
.fogDensity(2.2F)

View file

@ -10,6 +10,8 @@ import net.minecraft.world.level.levelgen.feature.Feature;
import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.features.BCLCommonFeatures;
import ru.bclib.api.features.BCLFeatureBuilder;
import ru.bclib.util.WeightedList;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.bclib.world.features.BCLFeature;
@ -28,7 +30,7 @@ public class EndCaveBiome extends EndBiome {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
BCLFeature feature = BCLFeature.makeChunkFeature(
BCLFeature feature = BCLCommonFeatures.makeChunkFeature(
BetterEnd.makeID(ID.getPath() + "_cave_populator"),
GenerationStep.Decoration.RAW_GENERATION,
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(ID))

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -37,7 +38,7 @@ public class AmberLandBiome extends EndBiome.Config {
.feature(EndFeatures.BULB_MOSS_WOOD)
.feature(EndFeatures.CHARNIA_ORANGE)
.feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 4)
.spawn(EndEntities.END_SLIME, 30, 1, 2);
}

View file

@ -2,6 +2,7 @@ package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.worldgen.placement.EndPlacements;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
@ -40,7 +41,7 @@ public class ChorusForestBiome extends EndBiome.Config {
.feature(EndFeatures.TAIL_MOSS_WOOD)
.feature(EndFeatures.CHARNIA_PURPLE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EndEntities.END_SLIME, 5, 1, 2)
.spawn(EntityType.ENDERMAN, 50, 1, 4);
}

View file

@ -18,7 +18,7 @@ public class CrystalMountainsBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder
.structure(EndStructures.MOUNTAIN.getFeatureConfigured())
.structure(EndStructures.MOUNTAIN)
.plantsColor(255, 133, 211)
.music(EndSounds.MUSIC_OPENSPACE)
.feature(EndFeatures.CRYSTAL_GRASS)

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -27,7 +28,7 @@ public class DryShrublandBiome extends EndBiome.Config {
.feature(EndFeatures.AERIDIUM)
.feature(EndFeatures.LUTEBUS)
.feature(EndFeatures.LAMELLARIUM)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}

View file

@ -1,6 +1,7 @@
package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
@ -28,7 +29,7 @@ public class DustWastelandsBiome extends EndBiome.Config {
.particles(ParticleTypes.WHITE_ASH, 0.01F)
.loop(EndSounds.AMBIENT_DUST_WASTELANDS)
.music(EndSounds.MUSIC_OPENSPACE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@ -45,7 +46,7 @@ public class DustWastelandsBiome extends EndBiome.Config {
return super
.surface()
.ceil(Blocks.END_STONE.defaultBlockState())
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, CaveSurface.FLOOR),
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
));
}

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -20,7 +21,7 @@ public class FoggyMushroomlandBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder
.structure(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured())
.structure(EndStructures.GIANT_MOSSY_GLOWSHROOM)
.plantsColor(73, 210, 209)
.fogColor(41, 122, 173)
.fogDensity(3)
@ -42,7 +43,7 @@ public class FoggyMushroomlandBiome extends EndBiome.Config {
.feature(EndFeatures.CHARNIA_CYAN)
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EndEntities.DRAGONFLY, 80, 2, 5)
.spawn(EndEntities.END_FISH, 20, 2, 5)
.spawn(EndEntities.CUBOZOA, 10, 3, 8)

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -38,7 +39,7 @@ public class GlowingGrasslandsBiome extends EndBiome.Config {
.feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -38,7 +39,7 @@ public class LanternWoodsBiome extends EndBiome.Config {
.feature(EndFeatures.CHARNIA_RED)
.feature(EndFeatures.RUSCUS)
.feature(EndFeatures.RUSCUS_WOOD)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}

View file

@ -19,7 +19,7 @@ public class MegalakeBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder
.structure(EndStructures.MEGALAKE.getFeatureConfigured())
.structure(EndStructures.MEGALAKE)
.plantsColor(73, 210, 209)
.fogColor(178, 209, 248)
.waterAndFogColor(96, 163, 255)

View file

@ -20,7 +20,7 @@ public class MegalakeGroveBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder
.structure(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
.structure(EndStructures.MEGALAKE_SMALL)
.plantsColor(73, 210, 209)
.fogColor(178, 209, 248)
.waterAndFogColor(96, 163, 255)

View file

@ -1,6 +1,7 @@
package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
@ -41,7 +42,7 @@ public class NeonOasisBiome extends EndBiome.Config {
.feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_CYAN)
.feature(EndFeatures.CHARNIA_RED)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}
@ -71,7 +72,7 @@ public class NeonOasisBiome extends EndBiome.Config {
.surface()
.ceil(Blocks.END_STONE.defaultBlockState())
.rule(1, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR),
.rule(4, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, CaveSurface.FLOOR),
SurfaceRules.state(EndBlocks.ENDSTONE_DUST.defaultBlockState())
));
}

View file

@ -18,7 +18,7 @@ public class PaintedMountainsBiome extends EndBiome.Config {
@Override
protected void addCustomBuildData(BCLBiomeBuilder builder) {
builder
.structure(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
.structure(EndStructures.PAINTED_MOUNTAIN)
.fogColor(226, 239, 168)
.fogDensity(2)
.waterAndFogColor(192, 180, 131)

View file

@ -1,6 +1,7 @@
package ru.betterend.world.biome.land;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -40,7 +41,7 @@ public class ShadowForestBiome extends EndBiome.Config {
.feature(EndFeatures.TAIL_MOSS_WOOD)
.feature(EndFeatures.CHARNIA_PURPLE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
.spawn(EntityType.ENDERMAN, 40, 1, 4)
.spawn(EntityType.PHANTOM, 1, 1, 2);

View file

@ -86,7 +86,7 @@ public class SulphurSpringsBiome extends EndBiome.Config {
return super
.surface()
.rule(2, SurfaceRules.ifTrue(SurfaceRules.ON_FLOOR, surfaceBlockRule))
.rule(2, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, false, CaveSurface.FLOOR), surfaceBlockRule));
.rule(2, SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(5, false, CaveSurface.FLOOR), surfaceBlockRule));
}
};
}

View file

@ -1,5 +1,6 @@
package ru.betterend.world.biome.land;
import net.minecraft.tags.BiomeTags;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder;
@ -42,7 +43,7 @@ public class UmbrellaJungleBiome extends EndBiome.Config {
.feature(EndFeatures.CHARNIA_GREEN)
.feature(EndFeatures.CHARNIA_LIGHT_BLUE)
.feature(EndFeatures.CHARNIA_RED_RARE)
.structure(VANILLA_FEATURES.getEndCity())
.structure(BiomeTags.HAS_END_CITY)
.spawn(EntityType.ENDERMAN, 50, 1, 2);
}

View file

@ -2,6 +2,7 @@ package ru.betterend.world.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
@ -29,7 +30,7 @@ public class BiomeIslandFeature extends DefaultFeature {
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
Biome biome = world.getBiome(pos);
//Holder<Biome> biome = world.getBiome(pos);
int dist = BlocksHelper.downRay(world, pos, 10) + 1;
BlockPos surfacePos = new BlockPos(pos.getX(), pos.getY()-dist, pos.getZ());
BlockState topMaterial = EndBiome.findTopMaterial(world, surfacePos);;

View file

@ -1,6 +1,7 @@
package ru.betterend.world.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.ChestBlock;
@ -42,7 +43,7 @@ public class BuildingListFeature extends ListFeature {
BlockEntity entity = chestBlock.newBlockEntity(chestPos, blockState);
levelReader.getChunk(chestPos).setBlockEntity(entity);
RandomizableContainerBlockEntity chestEntity = RandomizableContainerBlockEntity.class.cast(entity);
Biome biome = levelReader.getNoiseBiome(
Holder<Biome> biome = levelReader.getNoiseBiome(
chestPos.getX() >> 2,
chestPos.getY() >> 2,
chestPos.getZ() >> 2

View file

@ -5,6 +5,7 @@ import com.google.common.collect.Sets;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.Vec3i;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
@ -227,7 +228,7 @@ public abstract class EndCaveFeature extends DefaultFeature {
protected boolean biomeMissingCaves(WorldGenLevel world, BlockPos pos) {
for (int x = -2; x < 3; x++) {
for (int z = -2; z < 3; z++) {
Biome biome = world.getBiome(pos.offset(x << 4, 0, z << 4));
Holder<Biome> biome = world.getBiome(pos.offset(x << 4, 0, z << 4));
BCLBiome endBiome = BiomeAPI.getFromBiome(biome);
boolean hasCaves = endBiome.getCustomData("has_caves", true);
if (!hasCaves && BiomeAPI.END_LAND_BIOME_PICKER.containsImmutable(endBiome.getID())) {

View file

@ -5,6 +5,7 @@ import com.google.common.collect.Sets;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.util.Mth;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
@ -227,7 +228,7 @@ public class TunelCaveFeature extends EndCaveFeature {
}
protected boolean hasCavesInBiome(WorldGenLevel world, BlockPos pos) {
Biome biome = world.getBiome(pos);
Holder<Biome> biome = world.getBiome(pos);
BCLBiome endBiome = BiomeAPI.getFromBiome(biome);
return endBiome.getCustomData("has_caves", true);
}

View file

@ -1,6 +1,7 @@
package ru.betterend.world.structures.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.biome.Biome;
@ -34,7 +35,7 @@ public class MegaLakeSmallStructure extends FeatureBaseStructure {
int z = chunkPos.getBlockZ(MHelper.randRange(4, 12, random));
int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor);
Biome biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
Holder<Biome> biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
if (y > 5) {
float radius = MHelper.randRange(20, 40, random);
float depth = MHelper.randRange(5, 10, random);

View file

@ -1,6 +1,7 @@
package ru.betterend.world.structures.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.biome.Biome;
@ -36,7 +37,7 @@ public class MegaLakeStructure extends FeatureBaseStructure {
int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor);
if (y > 5) {
Biome biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
Holder<Biome> biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
float radius = MHelper.randRange(32, 64, random);
float depth = MHelper.randRange(7, 15, random);

View file

@ -1,6 +1,7 @@
package ru.betterend.world.structures.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.biome.Biome;
@ -34,7 +35,7 @@ public class MountainStructure extends FeatureBaseStructure {
int z = chunkPos.getBlockZ(MHelper.randRange(4, 12, random));
int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor);
if (y > 5) {
Biome biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
Holder<Biome> biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
float radius = MHelper.randRange(50, 100, random);
float height = radius * MHelper.randRange(0.8F, 1.2F, random);
CrystalMountainPiece piece = new CrystalMountainPiece(

View file

@ -1,6 +1,7 @@
package ru.betterend.world.structures.features;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.biome.Biome;
@ -38,7 +39,7 @@ public class PaintedMountainStructure extends FeatureBaseStructure {
int z = chunkPos.getBlockZ(MHelper.randRange(4, 12, random));
int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor);
if (y > 50) {
Biome biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
Holder<Biome> biome = chunkGenerator.getNoiseBiome(x >> 2, y >> 2, z >> 2);
float radius = MHelper.randRange(50, 100, random);
float height = radius * MHelper.randRange(0.4F, 0.6F, random);
int count = MHelper.floor(height * MHelper.randRange(0.1F, 0.35F, random) + 1);

View file

@ -2,6 +2,7 @@ package ru.betterend.world.structures.piece;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Mth;
import net.minecraft.world.level.ChunkPos;
@ -29,9 +30,9 @@ import java.util.Random;
public class CrystalMountainPiece extends MountainPiece {
private BlockState top;
public CrystalMountainPiece(BlockPos center, float radius, float height, Random random, Biome biome) {
public CrystalMountainPiece(BlockPos center, float radius, float height, Random random, Holder<Biome> biome) {
super(EndStructures.MOUNTAIN_PIECE, center, radius, height, random, biome);
top = EndBiome.findTopMaterial(biome); //biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
top = EndBiome.findTopMaterial(biome.value()); //biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
}
public CrystalMountainPiece(StructurePieceSerializationContext type, CompoundTag tag) {

View file

@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.Holder;
import net.minecraft.core.SectionPos;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
@ -46,7 +47,7 @@ public class LakePiece extends BasePiece {
private ResourceLocation biomeID;
public LakePiece(BlockPos center, float radius, float depth, Random random, Biome biome) {
public LakePiece(BlockPos center, float radius, float depth, Random random, Holder<Biome> biome) {
super(EndStructures.LAKE_PIECE, random.nextInt(), null);
this.center = center;
this.radius = radius;
@ -54,7 +55,7 @@ public class LakePiece extends BasePiece {
this.seed = random.nextInt();
this.noise = new OpenSimplexNoise(this.seed);
this.aspect = radius / depth;
this.biomeID = BiomeAPI.getBiomeID(biome);
this.biomeID = BiomeAPI.getBiomeID(biome.value());
makeBoundingBox();
}

View file

@ -3,6 +3,7 @@ package ru.betterend.world.structures.piece;
import com.google.common.collect.Maps;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.resources.ResourceLocation;
@ -31,7 +32,7 @@ public abstract class MountainPiece extends BasePiece {
protected int seed1;
protected int seed2;
public MountainPiece(StructurePieceType type, BlockPos center, float radius, float height, Random random, Biome biome) {
public MountainPiece(StructurePieceType type, BlockPos center, float radius, float height, Random random, Holder<Biome> biome) {
super(type, random.nextInt(), null);
this.center = center;
this.radius = radius;

View file

@ -2,6 +2,7 @@ package ru.betterend.world.structures.piece;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Holder;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
import net.minecraft.nbt.NbtUtils;
@ -25,7 +26,7 @@ import java.util.Random;
public class PaintedMountainPiece extends MountainPiece {
private BlockState[] slises;
public PaintedMountainPiece(BlockPos center, float radius, float height, Random random, Biome biome, BlockState[] slises) {
public PaintedMountainPiece(BlockPos center, float radius, float height, Random random, Holder<Biome> biome, BlockState[] slises) {
super(EndStructures.PAINTED_MOUNTAIN_PIECE, center, radius, height, random, biome);
this.slises = slises;
}

View file

@ -7,7 +7,6 @@
"ChorusPlantFeatureMixin",
"PlayerAdvancementsMixin",
"ChorusFlowerBlockMixin",
"StructureFeaturesMixin",
"NoiseInterpolatorMixin",
"ChorusPlantBlockMixin",
"EndPodiumFeatureMixin",