From 6c6a031d3318bd87cc8c2842897bb778132c77c6 Mon Sep 17 00:00:00 2001 From: CDAGaming Date: Sat, 12 Mar 2022 14:29:56 -0600 Subject: [PATCH] [Change] 1.18.2 Port --- CHANGELOG.md | 5 +- build.gradle | 11 +- gradle.properties | 26 +- src/main/java/net/id/aether/Aether.java | 6 +- .../java/net/id/aether/api/ConditionAPI.java | 2 +- .../id/aether/api/FloatingBlockHelper.java | 9 +- .../blockentity/IncubatorBlockEntity.java | 2 +- .../blocks/natural/AetherGrassBlock.java | 9 +- .../blocks/natural/AetherMushroomBlock.java | 3 +- .../blocks/natural/AetherQuicksoilBlock.java | 5 +- .../natural/AetherWallMushroomBlock.java | 3 +- .../natural/plant/AetherBrushBlock.java | 5 +- .../natural/plant/AetherTallBrushBlock.java | 5 +- .../natural/plant/CinnabarRoseBlock.java | 3 +- .../natural/plant/GroundcoverBlock.java | 3 +- .../blocks/natural/plant/LichenBlock.java | 3 +- .../blocks/natural/plant/LichenPileBlock.java | 4 +- .../natural/plant/WallClingingPlantBlock.java | 5 +- .../blocks/natural/tree/LeafPileBlock.java | 3 +- .../net/id/aether/component/MoaGenes.java | 2 +- .../id/aether/effect/condition/Condition.java | 8 +- .../entities/hostile/swet/BlueSwetEntity.java | 2 +- .../mixin/client/MinecraftClientMixin.java | 4 +- .../client/render/FluidRendererMixin.java | 5 +- .../client/render/WorldRendererMixin.java | 2 +- .../devel/client/SpriteAtlasTextureMixin.java | 8 +- .../mixin/entity/LivingEntityMixin.java | 2 +- .../id/aether/mixin/item/AxeItemMixin.java | 3 +- .../structure/StructureFeatureAccessor.java | 14 + .../id/aether/registry/AetherRegistries.java | 6 +- .../net/id/aether/tag/AetherBlockTags.java | 45 ++-- .../id/aether/tag/AetherEntityTypeTags.java | 26 +- .../net/id/aether/tag/AetherFluidTags.java | 18 +- .../net/id/aether/tag/AetherItemTags.java | 26 +- .../aether/world/dimension/AetherBiomes.java | 25 +- .../AetherConfiguredFeatures.java | 33 ++- .../AetherMiscConfiguredFeatures.java | 47 ++-- .../AetherTreeConfiguredFeatures.java | 83 +++--- .../AetherVegetationConfiguredFeatures.java | 50 ++-- .../feature/features/AetherLakeFeature.java | 215 ++++++++------- .../features/FreezeAetherTopLayerFeature.java | 2 +- .../AetherMiscPlacedFeatures.java | 35 +-- .../placed_features/AetherPlacedFeatures.java | 15 +- .../AetherTreePlacedFeatures.java | 80 +++--- .../AetherVegetationPlacedFeatures.java | 46 ++-- .../AetherPlacementModifiers.java | 4 +- .../ChancePlacementModifier.java | 4 +- .../CrystalTreeIslandPlacementModifier.java | 8 +- .../structure/AetherStructureFeatures.java | 2 +- .../BorealWisteriaSaplingGenerator.java | 3 +- .../generator/CrystalSaplingGenerator.java | 3 +- .../FrostWisteriaSaplingGenerator.java | 3 +- .../generator/GoldenOakSaplingGenerator.java | 3 +- .../LavenderWisteriaSaplingGenerator.java | 3 +- .../generator/OrangeSaplingGenerator.java | 3 +- .../RoseWisteriaSaplingGenerator.java | 3 +- .../generator/SkyrootSaplingGenerator.java | 3 +- .../world/gen/carver/AetherCarvers.java | 21 +- .../aether/world/gen/carver/CloudCarver.java | 5 +- .../the_aether/dimension_type/the_aether.json | 2 +- .../orange_ruin.json | 4 +- .../skyroot_tower.json | 4 +- .../configured_structure_feature/well.json | 4 +- .../worldgen/noise_settings/aether_noise.json | 246 +++++++++++++++++- src/main/resources/the_aether.mixins.json | 1 + 65 files changed, 778 insertions(+), 465 deletions(-) create mode 100644 src/main/java/net/id/aether/mixin/structure/StructureFeatureAccessor.java diff --git a/CHANGELOG.md b/CHANGELOG.md index cc2b020cf..8e34b9c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ -# Fixes +# Changes -- Resolved an incompatibility with Spectrum -- Optimized Image file sizes +- Ported to 1.18.2 # Advisory: 1.17 -> 1.18 World Migration diff --git a/build.gradle b/build.gradle index 817eaaf42..2d897bf89 100644 --- a/build.gradle +++ b/build.gradle @@ -1,12 +1,15 @@ buildscript { dependencies { - classpath "de.guntram.mcmod:crowdin-translate:${project.crowdin_translate_version}" + classpath "com.github.CDAGaming.CrowdinTranslate:crowdin-translate:${project.crowdin_translate_version}" } repositories { maven { name = 'CrowdinTranslate source' url = "https://minecraft.guntram.de/maven/" } + maven { + url = "https://jitpack.io" + } } } @@ -90,11 +93,11 @@ dependencies { // Libraries modImplementation(include("com.jamieswhiteshirt:reach-entity-attributes:${project.entity_attributes_version}")) - modImplementation(include("de.guntram.mcmod:crowdin-translate:${project.crowdin_translate_version}")) + modImplementation(include("com.github.CDAGaming.CrowdinTranslate:crowdin-translate:${project.crowdin_translate_version}")) - modImplementation(include("io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:${project.cardinal_version}")) + modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cardinal_version}")) - modImplementation(include("io.github.onyxstudios.Cardinal-Components-API:cardinal-components-entity:${project.cardinal_version}")) + modImplementation(include("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cardinal_version}")) // Most important of the libraries :smug: modImplementation(include("com.github.devs-immortal:Incubus-Core:${project.incubus_version}")) diff --git a/gradle.properties b/gradle.properties index 6cdcb225d..8b224ecf0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,25 +3,25 @@ org.gradle.jvmargs=-Xmx2G max_errors=400 # Mod Properties -mod_version=1.6.5.3+1.18.1 +mod_version=1.6.6+1.18.2 maven_group=com.aether archives_base_name=paradise-lost # Fabric Properties # check these on https://fabricmc.net/versions.html -minecraft_version=1.18.1 -mappings_version=1.18.1+build.22 -loader_version=0.12.12 +minecraft_version=1.18.2 +mappings_version=1.18.2+build.1 +loader_version=0.13.3 # Dependencies # suppress inspection "UnusedProperty" -fabric_api_version=0.46.4+1.18 -incubus_version=1.6.6-1.18.1 -customportalapi_version=0.0.1-beta49-1.18 -cardinal_version=4.0.1 -trinkets_version=3.1.0 -crowdin_translate_version=1.3+1.17 +fabric_api_version=0.47.8+1.18.2 +incubus_version=1.6.6-1.18.2 +customportalapi_version=0.0.1-beta50-1.18 +cardinal_version=4.1.3 +trinkets_version=3.3.0 +crowdin_translate_version=1.18.2 entity_attributes_version=2.1.1 -modmenu_version=3.0.1 -rei_version=7.2.409 -moretags_version=2.0.2 +modmenu_version=3.1.0 +rei_version=8.0.442 +moretags_version=3.0.0 recipeconfidence_version=1.0.2 customshaderlib_version=1.0.0 diff --git a/src/main/java/net/id/aether/Aether.java b/src/main/java/net/id/aether/Aether.java index 0f84a9bd1..cace9a7c9 100755 --- a/src/main/java/net/id/aether/Aether.java +++ b/src/main/java/net/id/aether/Aether.java @@ -38,8 +38,8 @@ import net.id.aether.world.feature.AetherFeatures; import net.id.aether.world.gen.carver.AetherCarvers; import net.minecraft.util.Identifier; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Docs for Paradise Lost are sometimes written long after @@ -61,7 +61,7 @@ */ public class Aether implements ModInitializer, ClientModInitializer { public static final String MOD_ID = "the_aether"; - public static final Logger LOG = LogManager.getLogger(MOD_ID); + public static final Logger LOG = LoggerFactory.getLogger(MOD_ID); /** * Creates a new {@link Identifier} based on the passed location. diff --git a/src/main/java/net/id/aether/api/ConditionAPI.java b/src/main/java/net/id/aether/api/ConditionAPI.java index cfca960d1..0f82bfa31 100644 --- a/src/main/java/net/id/aether/api/ConditionAPI.java +++ b/src/main/java/net/id/aether/api/ConditionAPI.java @@ -26,7 +26,7 @@ public class ConditionAPI { public static List getValidConditions(EntityType type) { return AetherRegistries.CONDITION_REGISTRY .stream() - .filter(condition -> !condition.exempt.contains(type)) + .filter(condition -> !type.isIn(condition.exempt)) .collect(Collectors.toList()); } diff --git a/src/main/java/net/id/aether/api/FloatingBlockHelper.java b/src/main/java/net/id/aether/api/FloatingBlockHelper.java index 877d769fa..0163d99d4 100644 --- a/src/main/java/net/id/aether/api/FloatingBlockHelper.java +++ b/src/main/java/net/id/aether/api/FloatingBlockHelper.java @@ -1,5 +1,6 @@ package net.id.aether.api; +import net.gudenau.minecraft.moretags.MoreBlockTags; import net.gudenau.minecraft.moretags.MoreTags; import net.id.aether.entities.block.FloatingBlockEntity; import net.id.aether.entities.util.FloatingBlockStructure; @@ -339,7 +340,7 @@ private static boolean continueTree(World world, BlockPos pos, StructureBuilder return false; } // sides and bottom (sticky blocks) - if (state.isIn(MoreTags.STICKY_BLOCKS)) { + if (state.isIn(MoreBlockTags.STICKY_BLOCKS)) { // checks each of the sides for (var newPos : new BlockPos[]{ pos.north(), @@ -362,12 +363,12 @@ private static boolean continueTree(World world, BlockPos pos, StructureBuilder } private static boolean isAdjacentBlockStuck(BlockState state, BlockState adjacentState) { - if (state.isIn(MoreTags.HONEY_BLOCKS) && adjacentState.isIn(MoreTags.SLIME_BLOCKS)) { + if (state.isIn(MoreBlockTags.HONEY_BLOCKS) && adjacentState.isIn(MoreBlockTags.SLIME_BLOCKS)) { return false; - } else if (state.isIn(MoreTags.SLIME_BLOCKS) && adjacentState.isIn(MoreTags.HONEY_BLOCKS)) { + } else if (state.isIn(MoreBlockTags.SLIME_BLOCKS) && adjacentState.isIn(MoreBlockTags.HONEY_BLOCKS)) { return false; } else { - return state.isIn(MoreTags.STICKY_BLOCKS) || adjacentState.isIn(MoreTags.STICKY_BLOCKS); + return state.isIn(MoreBlockTags.STICKY_BLOCKS) || adjacentState.isIn(MoreBlockTags.STICKY_BLOCKS); } } }; diff --git a/src/main/java/net/id/aether/blocks/blockentity/IncubatorBlockEntity.java b/src/main/java/net/id/aether/blocks/blockentity/IncubatorBlockEntity.java index c31ac43fd..e065d97a9 100644 --- a/src/main/java/net/id/aether/blocks/blockentity/IncubatorBlockEntity.java +++ b/src/main/java/net/id/aether/blocks/blockentity/IncubatorBlockEntity.java @@ -45,7 +45,7 @@ public void handleUse(PlayerEntity player, Hand hand, ItemStack handStack) { ItemStack stored = inventory.get(0); inventory.set(0, handStack); player.setStackInHand(hand, stored); - hatchTicks = (int) (12000 / world.getBiome(pos).getTemperature()); + hatchTicks = (int) (12000 / world.getBiome(pos).value().getTemperature()); } @Override diff --git a/src/main/java/net/id/aether/blocks/natural/AetherGrassBlock.java b/src/main/java/net/id/aether/blocks/natural/AetherGrassBlock.java index 6005bb7fd..eeb5e3c55 100644 --- a/src/main/java/net/id/aether/blocks/natural/AetherGrassBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/AetherGrassBlock.java @@ -7,6 +7,7 @@ import net.minecraft.block.Fertilizable; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.gen.feature.ConfiguredFeature; @@ -36,7 +37,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat BlockPos blockPos = pos.up(); BlockState blockState = AetherBlocks.AETHER_GRASS.getDefaultState(); block0: for (int i = 0; i < 128; ++i) { - PlacedFeature placedFeature; + RegistryEntry placedFeature; BlockPos blockPos2 = blockPos; for (int j = 0; j < i / 16; ++j) { @@ -56,13 +57,13 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat if (!blockState2.isAir()) continue; if (random.nextInt(8) == 0) { - List> list = world.getBiome(blockPos2).getGenerationSettings().getFlowerFeatures(); + List> list = world.getBiome(blockPos2).value().getGenerationSettings().getFlowerFeatures(); if (list.isEmpty()) continue; - placedFeature = ((RandomPatchFeatureConfig)list.get(0).getConfig()).feature().get(); + placedFeature = ((RandomPatchFeatureConfig)list.get(0).config()).feature(); } else { placedFeature = AetherVegetationPlacedFeatures.AETHER_GRASS_BONEMEAL; } - placedFeature.generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2); + placedFeature.value().generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2); } } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/blocks/natural/AetherMushroomBlock.java b/src/main/java/net/id/aether/blocks/natural/AetherMushroomBlock.java index 7bf7f9b47..7c7caf515 100644 --- a/src/main/java/net/id/aether/blocks/natural/AetherMushroomBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/AetherMushroomBlock.java @@ -6,6 +6,7 @@ import net.minecraft.server.world.ServerWorld; import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShapes; import net.minecraft.world.BlockView; @@ -19,7 +20,7 @@ public class AetherMushroomBlock extends MushroomPlantBlock { private final HangType type; - public AetherMushroomBlock(Settings settings, Supplier> feature, HangType type) { + public AetherMushroomBlock(Settings settings, Supplier>> feature, HangType type) { super(settings, feature); this.type = type; } diff --git a/src/main/java/net/id/aether/blocks/natural/AetherQuicksoilBlock.java b/src/main/java/net/id/aether/blocks/natural/AetherQuicksoilBlock.java index 9dba80351..af9897404 100644 --- a/src/main/java/net/id/aether/blocks/natural/AetherQuicksoilBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/AetherQuicksoilBlock.java @@ -7,6 +7,7 @@ import net.minecraft.block.Fertilizable; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.gen.feature.PlacedFeature; @@ -34,7 +35,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat BlockState blockState = AetherBlocks.FLUTEGRASS.getDefaultState(); block0: for (int i = 0; i < 128; ++i) { - PlacedFeature placedFeature; + RegistryEntry placedFeature; BlockPos blockPos2 = blockPos; for (int j = 0; j < i / 16; ++j) { @@ -54,7 +55,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat if (!blockState2.isAir()) continue; placedFeature = AetherVegetationPlacedFeatures.FLUTEGRASS_BONEMEAL; - placedFeature.generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2); + placedFeature.value().generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2); } } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/blocks/natural/AetherWallMushroomBlock.java b/src/main/java/net/id/aether/blocks/natural/AetherWallMushroomBlock.java index 916eb24a8..d52c62c6f 100644 --- a/src/main/java/net/id/aether/blocks/natural/AetherWallMushroomBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/AetherWallMushroomBlock.java @@ -9,6 +9,7 @@ import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.BlockView; import net.minecraft.world.WorldView; import net.minecraft.world.gen.feature.ConfiguredFeature; @@ -20,7 +21,7 @@ public class AetherWallMushroomBlock extends AetherMushroomBlock { public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING; - public AetherWallMushroomBlock(Settings settings, Supplier> feature) { + public AetherWallMushroomBlock(Settings settings, Supplier>> feature) { super(settings, feature, AetherMushroomBlock.HangType.WALL); } diff --git a/src/main/java/net/id/aether/blocks/natural/plant/AetherBrushBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/AetherBrushBlock.java index 6eafb72bc..414831fbc 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/AetherBrushBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/AetherBrushBlock.java @@ -8,6 +8,7 @@ import net.minecraft.block.TallPlantBlock; import net.minecraft.server.world.ServerWorld; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; @@ -16,14 +17,14 @@ public class AetherBrushBlock extends FernBlock { - private final Tag validFloors; + private final TagKey validFloors; private final boolean override; public AetherBrushBlock(Settings settings) { this(settings, AetherBlockTags.GENERIC_VALID_GROUND, false); } - public AetherBrushBlock(Settings settings, Tag validFloors, boolean override) { + public AetherBrushBlock(Settings settings, TagKey validFloors, boolean override) { super(settings); this.validFloors = validFloors; this.override = override; diff --git a/src/main/java/net/id/aether/blocks/natural/plant/AetherTallBrushBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/AetherTallBrushBlock.java index da4a88fbf..c06c1932f 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/AetherTallBrushBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/AetherTallBrushBlock.java @@ -5,20 +5,21 @@ import net.minecraft.block.BlockState; import net.minecraft.block.TallPlantBlock; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; public class AetherTallBrushBlock extends TallPlantBlock { - private final Tag validFloors; + private final TagKey validFloors; private final boolean override; public AetherTallBrushBlock(Settings settings) { this(settings, AetherBlockTags.GENERIC_VALID_GROUND, false); } - public AetherTallBrushBlock(Settings settings, Tag validFloors, boolean override) { + public AetherTallBrushBlock(Settings settings, TagKey validFloors, boolean override) { super(settings); this.validFloors = validFloors; this.override = override; diff --git a/src/main/java/net/id/aether/blocks/natural/plant/CinnabarRoseBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/CinnabarRoseBlock.java index c5a2dd732..14a4738e6 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/CinnabarRoseBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/CinnabarRoseBlock.java @@ -13,6 +13,7 @@ import net.minecraft.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.BlockView; import net.minecraft.world.World; import net.minecraft.world.WorldView; @@ -26,7 +27,7 @@ public class CinnabarRoseBlock extends AetherMushroomBlock { public static final BooleanProperty BLOOMING = BooleanProperty.of("blooming"); - public CinnabarRoseBlock(Settings settings, Supplier> feature) { + public CinnabarRoseBlock(Settings settings, Supplier>> feature) { super(settings, feature, HangType.FLOOR); setDefaultState(getDefaultState().with(BLOOMING, false)); } diff --git a/src/main/java/net/id/aether/blocks/natural/plant/GroundcoverBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/GroundcoverBlock.java index 1afd509a3..deaaa1581 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/GroundcoverBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/GroundcoverBlock.java @@ -8,6 +8,7 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.util.shape.VoxelShape; @@ -24,7 +25,7 @@ public GroundcoverBlock(Settings settings, double slowdown) { this.slowdown = slowdown; } - public GroundcoverBlock(Settings settings, Tag validFloors, boolean override, double slowdown) { + public GroundcoverBlock(Settings settings, TagKey validFloors, boolean override, double slowdown) { super(settings, validFloors, override); this.slowdown = slowdown; } diff --git a/src/main/java/net/id/aether/blocks/natural/plant/LichenBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/LichenBlock.java index 5feac1258..c607048ff 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/LichenBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/LichenBlock.java @@ -99,8 +99,7 @@ public void tryFall(World world, BlockPos pos, BlockState state) { if (state.getPistonBehavior().equals(PistonBehavior.BLOCK) || state.getBlock().getHardness() == -1F){ return; } - FallingBlockEntity fallingBlockEntity = new FallingBlockEntity(world, (double)pos.getX() + 0.5D, (double)pos.getY(), (double)pos.getZ() + 0.5D, state); - world.spawnEntity(fallingBlockEntity); + FallingBlockEntity fallingBlockEntity = FallingBlockEntity.spawnFromBlock(world, pos, state); this.configureFallingBlockEntity(fallingBlockEntity); BlockPos.iterateOutwards(pos, 1, 0, 1).forEach(checkPos -> { diff --git a/src/main/java/net/id/aether/blocks/natural/plant/LichenPileBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/LichenPileBlock.java index e65062ffe..4a1d7a0bb 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/LichenPileBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/LichenPileBlock.java @@ -77,8 +77,8 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat BlockPos.streamOutwards(pos, 3, 1, 3) .filter(world::isAir) .filter(temp -> { - var floor = world.getBlockState(temp).getBlock(); - return floor instanceof LichenBlock || AetherBlockTags.LICHEN_SPREADABLES.contains(floor); + var floor = world.getBlockState(temp); + return floor.getBlock() instanceof LichenBlock || floor.isIn(AetherBlockTags.LICHEN_SPREADABLES); }) .filter(temp -> random.nextInt(60) == 0) .forEach(spreadPoint -> world.setBlockState(spreadPoint, getDefaultState())); diff --git a/src/main/java/net/id/aether/blocks/natural/plant/WallClingingPlantBlock.java b/src/main/java/net/id/aether/blocks/natural/plant/WallClingingPlantBlock.java index f72787c98..4483534bf 100644 --- a/src/main/java/net/id/aether/blocks/natural/plant/WallClingingPlantBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/plant/WallClingingPlantBlock.java @@ -8,6 +8,7 @@ import net.minecraft.state.property.DirectionProperty; import net.minecraft.state.property.Properties; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; import net.minecraft.world.WorldView; @@ -16,9 +17,9 @@ public class WallClingingPlantBlock extends PlantBlock { public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING; - private final @Nullable Tag clingableBlocks; + private final @Nullable TagKey clingableBlocks; - public WallClingingPlantBlock(Settings settings, @Nullable Tag clingableBlocks) { + public WallClingingPlantBlock(Settings settings, @Nullable TagKey clingableBlocks) { super(settings); this.clingableBlocks = clingableBlocks; } diff --git a/src/main/java/net/id/aether/blocks/natural/tree/LeafPileBlock.java b/src/main/java/net/id/aether/blocks/natural/tree/LeafPileBlock.java index d88550348..a161e1d0c 100644 --- a/src/main/java/net/id/aether/blocks/natural/tree/LeafPileBlock.java +++ b/src/main/java/net/id/aether/blocks/natural/tree/LeafPileBlock.java @@ -25,8 +25,7 @@ public LeafPileBlock(Settings settings) { @Override public void onEntityCollision(BlockState state, World world, BlockPos pos, Entity entity) { if (canFallThrough(world.getBlockState(pos.down()))) { - FallingBlockEntity fallingBlockEntity = new FallingBlockEntity(world, (double) pos.getX() + 0.5D, pos.getY(), (double) pos.getZ() + 0.5D, state); - world.spawnEntity(fallingBlockEntity); + FallingBlockEntity fallingBlockEntity = FallingBlockEntity.spawnFromBlock(world, pos, state); this.configureFallingBlockEntity(fallingBlockEntity); } } diff --git a/src/main/java/net/id/aether/component/MoaGenes.java b/src/main/java/net/id/aether/component/MoaGenes.java index 4a5b71442..17375d5e3 100644 --- a/src/main/java/net/id/aether/component/MoaGenes.java +++ b/src/main/java/net/id/aether/component/MoaGenes.java @@ -69,7 +69,7 @@ public static MoaGenes get(@NotNull MoaEntity moa) { public void initMoa(@NotNull MoaEntity moa) { World world = moa.world; Random random = moa.getRandom(); - race = MoaAPI.getMoaForBiome(world.getBiomeKey(moa.getBlockPos()).get(), random); + race = MoaAPI.getMoaForBiome(world.getBiome(moa.getBlockPos()).getKey().get(), random); affinity = race.defaultAffinity(); for (MoaAttributes attribute : MoaAttributes.values()) { diff --git a/src/main/java/net/id/aether/effect/condition/Condition.java b/src/main/java/net/id/aether/effect/condition/Condition.java index a6eea4f01..f898f05d4 100644 --- a/src/main/java/net/id/aether/effect/condition/Condition.java +++ b/src/main/java/net/id/aether/effect/condition/Condition.java @@ -8,7 +8,9 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; import net.minecraft.world.World; /** @@ -41,7 +43,7 @@ public abstract class Condition { /** * A tag containing all {@code EntityType}s which cannot get this condition. */ - public final Tag> exempt; + public final TagKey> exempt; /** * The maximum value for the {@code Temporary} {@link Persistence}. */ @@ -77,7 +79,7 @@ public abstract class Condition { * @param visThreshold See {@link Condition#visThreshold} * @see Persistence */ - public Condition(Tag> exempt, float maxTemp, float maxChron, float tempDecay, float chronDecay, float scalingValue, float visThreshold) { + public Condition(TagKey> exempt, float maxTemp, float maxChron, float tempDecay, float chronDecay, float scalingValue, float visThreshold) { this.exempt = exempt; this.maxTemp = maxTemp; this.maxChron = maxChron; @@ -101,7 +103,7 @@ public final Identifier getId(){ * @return Whether the provided {@code LivingEntity} is exempt from the condition */ public final boolean isExempt(LivingEntity entity) { - return exempt.contains(entity.getType()); + return entity.getType().isIn(exempt); } /** diff --git a/src/main/java/net/id/aether/entities/hostile/swet/BlueSwetEntity.java b/src/main/java/net/id/aether/entities/hostile/swet/BlueSwetEntity.java index 000a9ea64..a07551bde 100644 --- a/src/main/java/net/id/aether/entities/hostile/swet/BlueSwetEntity.java +++ b/src/main/java/net/id/aether/entities/hostile/swet/BlueSwetEntity.java @@ -21,7 +21,7 @@ public void tickMovement() { int j = MathHelper.floor(this.getY()); int k = MathHelper.floor(this.getZ()); BlockPos blockPos = new BlockPos(i, j, k); - if (this.world.getBiome(blockPos).getTemperature() > 1.0f) { + if (this.world.getBiome(blockPos).value().getTemperature() > 1.0f) { this.damage(DamageSource.ON_FIRE, 1.0f); } } diff --git a/src/main/java/net/id/aether/mixin/client/MinecraftClientMixin.java b/src/main/java/net/id/aether/mixin/client/MinecraftClientMixin.java index a08828012..5f231dd22 100644 --- a/src/main/java/net/id/aether/mixin/client/MinecraftClientMixin.java +++ b/src/main/java/net/id/aether/mixin/client/MinecraftClientMixin.java @@ -22,7 +22,7 @@ public abstract class MinecraftClientMixin { @Shadow public abstract CompletableFuture reloadResources(); - @ModifyVariable(method = "startIntegratedServer(Ljava/lang/String;Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;Ljava/util/function/Function;Lcom/mojang/datafixers/util/Function4;ZLnet/minecraft/client/MinecraftClient$WorldLoadAction;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient$WorldLoadAction;NONE:Lnet/minecraft/client/MinecraftClient$WorldLoadAction;", ordinal = 0), ordinal = 2, index = 11, name = "bl2", require = 1) + @ModifyVariable(method = "startIntegratedServer(Ljava/lang/String;Ljava/util/function/Function;Ljava/util/function/Function;ZLnet/minecraft/client/MinecraftClient$WorldLoadAction;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient$WorldLoadAction;NONE:Lnet/minecraft/client/MinecraftClient$WorldLoadAction;", ordinal = 0), ordinal = 2, index = 11, name = "bl2", require = 1) private boolean replaceBl2(boolean bl2) { return false; } @@ -39,7 +39,7 @@ private boolean replaceBl2(boolean bl2) { private void getMusicType(CallbackInfoReturnable cir){ var world = player.world; if(world.getRegistryKey().equals(AetherDimension.AETHER_WORLD_KEY)){ - cir.setReturnValue(world.getBiomeAccess().getBiomeForNoiseGen(this.player.getBlockPos()).getMusic().orElse(AetherSoundEvents.Music.AETHER)); + cir.setReturnValue(world.getBiomeAccess().getBiomeForNoiseGen(this.player.getBlockPos()).value().getMusic().orElse(AetherSoundEvents.Music.AETHER)); } } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/mixin/client/render/FluidRendererMixin.java b/src/main/java/net/id/aether/mixin/client/render/FluidRendererMixin.java index 543a324f6..ce2c9df12 100644 --- a/src/main/java/net/id/aether/mixin/client/render/FluidRendererMixin.java +++ b/src/main/java/net/id/aether/mixin/client/render/FluidRendererMixin.java @@ -3,6 +3,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.id.aether.world.dimension.AetherDimension; +import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.VertexConsumer; import net.minecraft.client.render.block.FluidRenderer; @@ -25,10 +26,10 @@ public class FluidRendererMixin { private float fadeAlpha; @Inject(method = "render", at = @At("HEAD")) - private void render(BlockRenderView world, BlockPos pos, VertexConsumer builder, FluidState state, CallbackInfoReturnable info) { + private void render(BlockRenderView world, BlockPos pos, VertexConsumer vertexConsumer, BlockState blockState, FluidState fluidState, CallbackInfoReturnable cir) { fadeAlpha = 1F; if (MinecraftClient.getInstance().world.getRegistryKey() == AetherDimension.AETHER_WORLD_KEY) { - if (state.getFluid().matchesType(Fluids.WATER)) { + if (fluidState.getFluid().matchesType(Fluids.WATER)) { fadeAlpha = Math.min((pos.getY() - world.getBottomY()) / 32F, 1); } } diff --git a/src/main/java/net/id/aether/mixin/client/render/WorldRendererMixin.java b/src/main/java/net/id/aether/mixin/client/render/WorldRendererMixin.java index 4cd67170b..29fc8fbc4 100644 --- a/src/main/java/net/id/aether/mixin/client/render/WorldRendererMixin.java +++ b/src/main/java/net/id/aether/mixin/client/render/WorldRendererMixin.java @@ -19,7 +19,7 @@ public abstract class WorldRendererMixin { * @author gudenau */ @ModifyVariable( - method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FLjava/lang/Runnable;)V", + method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FLnet/minecraft/client/render/Camera;ZLjava/lang/Runnable;)V", at = @At( value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/world/ClientWorld$Properties;getSkyDarknessHeight(Lnet/minecraft/world/HeightLimitView;)D", diff --git a/src/main/java/net/id/aether/mixin/devel/client/SpriteAtlasTextureMixin.java b/src/main/java/net/id/aether/mixin/devel/client/SpriteAtlasTextureMixin.java index 6108b577e..9069c6e32 100644 --- a/src/main/java/net/id/aether/mixin/devel/client/SpriteAtlasTextureMixin.java +++ b/src/main/java/net/id/aether/mixin/devel/client/SpriteAtlasTextureMixin.java @@ -23,7 +23,7 @@ public abstract class SpriteAtlasTextureMixin{ method = "method_18160", at = @At( value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", + target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", ordinal = 0 ) ) @@ -37,7 +37,7 @@ public abstract class SpriteAtlasTextureMixin{ method = "method_18160", at = @At( value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", + target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", ordinal = 1 ) ) @@ -51,7 +51,7 @@ public abstract class SpriteAtlasTextureMixin{ method = "loadSprite", at = @At( value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", + target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", ordinal = 0 ) ) @@ -66,7 +66,7 @@ public abstract class SpriteAtlasTextureMixin{ method = "loadSprite", at = @At( value = "INVOKE", - target = "Lorg/apache/logging/log4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", + target = "Lorg/slf4j/Logger;error(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V", ordinal = 1 ) ) diff --git a/src/main/java/net/id/aether/mixin/entity/LivingEntityMixin.java b/src/main/java/net/id/aether/mixin/entity/LivingEntityMixin.java index b5c3d5614..30ba0b31c 100644 --- a/src/main/java/net/id/aether/mixin/entity/LivingEntityMixin.java +++ b/src/main/java/net/id/aether/mixin/entity/LivingEntityMixin.java @@ -70,7 +70,7 @@ private double changeGravity(double gravity) { // Get parachutes from trinket slots Optional componentOptional = TrinketsApi.getTrinketComponent(entity); boolean isWearingParachute = componentOptional.isPresent() - && AetherItemTags.PARACHUTES.values().stream().anyMatch(componentOptional.get()::isEquipped); + && componentOptional.get().isEquipped(e -> e.isIn(AetherItemTags.PARACHUTES)); if (isWearingParachute) { gravity -= 0.07; diff --git a/src/main/java/net/id/aether/mixin/item/AxeItemMixin.java b/src/main/java/net/id/aether/mixin/item/AxeItemMixin.java index 24167fa2c..7cee93900 100644 --- a/src/main/java/net/id/aether/mixin/item/AxeItemMixin.java +++ b/src/main/java/net/id/aether/mixin/item/AxeItemMixin.java @@ -11,6 +11,7 @@ import net.minecraft.loot.context.LootContextTypes; import net.minecraft.server.world.ServerWorld; import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; import net.minecraft.util.ActionResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; @@ -25,7 +26,7 @@ @Mixin(AxeItem.class) public class AxeItemMixin extends MiningToolItem { - protected AxeItemMixin(float attackDamage, float attackSpeed, ToolMaterial material, Tag effectiveBlocks, Settings settings) { + protected AxeItemMixin(float attackDamage, float attackSpeed, ToolMaterial material, TagKey effectiveBlocks, Settings settings) { super(attackDamage, attackSpeed, material, effectiveBlocks, settings); } diff --git a/src/main/java/net/id/aether/mixin/structure/StructureFeatureAccessor.java b/src/main/java/net/id/aether/mixin/structure/StructureFeatureAccessor.java new file mode 100644 index 000000000..4a22cac51 --- /dev/null +++ b/src/main/java/net/id/aether/mixin/structure/StructureFeatureAccessor.java @@ -0,0 +1,14 @@ +package net.id.aether.mixin.structure; + +import net.minecraft.world.gen.GenerationStep; +import net.minecraft.world.gen.feature.StructureFeature; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Invoker; + +@Mixin(StructureFeature.class) +public interface StructureFeatureAccessor { + @Invoker + static > F callRegister(String name, F structureFeature, GenerationStep.Feature step) { + throw new AssertionError("Untransformed accessor"); + } +} diff --git a/src/main/java/net/id/aether/registry/AetherRegistries.java b/src/main/java/net/id/aether/registry/AetherRegistries.java index 7d7fce12d..ef58b8119 100644 --- a/src/main/java/net/id/aether/registry/AetherRegistries.java +++ b/src/main/java/net/id/aether/registry/AetherRegistries.java @@ -17,8 +17,10 @@ public class AetherRegistries { public static void init() {} - public static final RegistryKey> CONDITION_REGISTRY_KEY = RegistryKey.ofRegistry(locate("condition")); - public static final Registry CONDITION_REGISTRY = (Registry) ((MutableRegistry) Registry.REGISTRIES).add(CONDITION_REGISTRY_KEY, new SimpleRegistry<>(CONDITION_REGISTRY_KEY, Lifecycle.experimental()), Lifecycle.experimental()); + // TODO VERIFY THIS IS A PROPER REPLACEMENT 1.18.2 + //public static final RegistryKey> CONDITION_REGISTRY_KEY = RegistryKey.ofRegistry(locate("condition")); + public static final Registry CONDITION_REGISTRY = FabricRegistryBuilder.createSimple(Condition.class, locate("condition")).buildAndRegister(); + //(Registry) ((MutableRegistry) Registry.REGISTRIES).add(CONDITION_REGISTRY_KEY, new SimpleRegistry<>(CONDITION_REGISTRY_KEY, Lifecycle.experimental(), null), Lifecycle.experimental()); /** * The registry for {@link LoreEntry}, try not to use this directly. Use the methods in {@link net.id.aether.lore.AetherLore}. diff --git a/src/main/java/net/id/aether/tag/AetherBlockTags.java b/src/main/java/net/id/aether/tag/AetherBlockTags.java index 41f3d1c2a..673f760e4 100644 --- a/src/main/java/net/id/aether/tag/AetherBlockTags.java +++ b/src/main/java/net/id/aether/tag/AetherBlockTags.java @@ -1,36 +1,39 @@ package net.id.aether.tag; -import net.fabricmc.fabric.api.tag.TagFactory; +import net.id.aether.Aether; import net.minecraft.block.Block; -import net.minecraft.tag.Tag; - -import static net.id.aether.Aether.locate; +import net.minecraft.tag.TagKey; +import net.minecraft.util.registry.Registry; public class AetherBlockTags { //Gravitite - public static final Tag FAST_FLOATERS = TagFactory.BLOCK.create(locate("fast_floaters")); - public static final Tag NON_FLOATERS = TagFactory.BLOCK.create(locate("non_floaters")); - public static final Tag PUSH_FLOATERS = TagFactory.BLOCK.create(locate("push_floaters")); - public static final Tag HURTABLE_FLOATERS = TagFactory.BLOCK.create(locate("hurtable_floaters")); + public static final TagKey FAST_FLOATERS = register("fast_floaters"); + public static final TagKey NON_FLOATERS = register("non_floaters"); + public static final TagKey PUSH_FLOATERS = register("push_floaters"); + public static final TagKey HURTABLE_FLOATERS = register("hurtable_floaters"); //Plants - public static final Tag LICHEN_SPREADABLES = TagFactory.BLOCK.create(locate("plants/lichen_spreadable")); - public static final Tag FUNGI_CLINGABLES = TagFactory.BLOCK.create(locate("plants/fungi_clingable")); - public static final Tag GENERIC_VALID_GROUND = TagFactory.BLOCK.create(locate("plants/generic_valid_ground")); - public static final Tag FLUTEGRASS_VALID_GROUND = TagFactory.BLOCK.create(locate("plants/flutegrass_valid_ground")); - public static final Tag AECHOR_PLANT_VALID_GROUND = TagFactory.BLOCK.create(locate("plants/aechor_plant_valid_ground")); + public static final TagKey LICHEN_SPREADABLES = register("plants/lichen_spreadable"); + public static final TagKey FUNGI_CLINGABLES = register("plants/fungi_clingable"); + public static final TagKey GENERIC_VALID_GROUND = register("plants/generic_valid_ground"); + public static final TagKey FLUTEGRASS_VALID_GROUND = register("plants/flutegrass_valid_ground"); + public static final TagKey AECHOR_PLANT_VALID_GROUND = register("plants/aechor_plant_valid_ground"); //Swets - public static final Tag SWET_TRANSFORMERS_BLUE = TagFactory.BLOCK.create(locate("swet_transformers/blue")); - public static final Tag SWET_TRANSFORMERS_GOLDEN = TagFactory.BLOCK.create(locate("swet_transformers/golden")); - public static final Tag SWET_TRANSFORMERS_PURPLE = TagFactory.BLOCK.create(locate("swet_transformers/purple")); - public static final Tag SWET_TRANSFORMERS_VERMILION = TagFactory.BLOCK.create(locate("swet_transformers/vermilion")); + public static final TagKey SWET_TRANSFORMERS_BLUE = register("swet_transformers/blue"); + public static final TagKey SWET_TRANSFORMERS_GOLDEN = register("swet_transformers/golden"); + public static final TagKey SWET_TRANSFORMERS_PURPLE = register("swet_transformers/purple"); + public static final TagKey SWET_TRANSFORMERS_VERMILION = register("swet_transformers/vermilion"); //Worldgen - public static final Tag BASE_AETHER_STONE = TagFactory.BLOCK.create(locate("worldgen/base_aether_stone")); - public static final Tag FLUID_REPLACEABLES = TagFactory.BLOCK.create(locate("worldgen/fluid_replaceable")); - public static final Tag BASE_REPLACEABLES = TagFactory.BLOCK.create(locate("worldgen/base_replaceables")); + public static final TagKey BASE_AETHER_STONE = register("worldgen/base_aether_stone"); + public static final TagKey FLUID_REPLACEABLES = register("worldgen/fluid_replaceable"); + public static final TagKey BASE_REPLACEABLES = register("worldgen/base_replaceables"); //JEB, WHY ARE SHEARS HARDCODED - public static final Tag AETHER_SHEARABLE = TagFactory.BLOCK.create(locate("mineable_by_shears")); + public static final TagKey AETHER_SHEARABLE = register("mineable_by_shears"); + + private static TagKey register(String id) { + return TagKey.of(Registry.BLOCK_KEY, Aether.locate(id)); + } } diff --git a/src/main/java/net/id/aether/tag/AetherEntityTypeTags.java b/src/main/java/net/id/aether/tag/AetherEntityTypeTags.java index 5241c9a9b..dc776cf6a 100644 --- a/src/main/java/net/id/aether/tag/AetherEntityTypeTags.java +++ b/src/main/java/net/id/aether/tag/AetherEntityTypeTags.java @@ -1,19 +1,23 @@ package net.id.aether.tag; -import net.fabricmc.fabric.api.tag.TagFactory; import net.id.aether.Aether; import net.minecraft.entity.EntityType; -import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.registry.Registry; public class AetherEntityTypeTags { - public static final Tag> SWET_TRANSFORMERS_BLUE = TagFactory.ENTITY_TYPE.create(Aether.locate("swet_transformers/blue")); - public static final Tag> SWET_TRANSFORMERS_GOLDEN = TagFactory.ENTITY_TYPE.create(Aether.locate("swet_transformers/golden")); - public static final Tag> SWET_TRANSFORMERS_PURPLE = TagFactory.ENTITY_TYPE.create(Aether.locate("swet_transformers/purple")); - public static final Tag> SWET_TRANSFORMERS_VERMILION = TagFactory.ENTITY_TYPE.create(Aether.locate("swet_transformers/vermilion")); + public static final TagKey> SWET_TRANSFORMERS_BLUE = register("swet_transformers/blue"); + public static final TagKey> SWET_TRANSFORMERS_GOLDEN = register("swet_transformers/golden"); + public static final TagKey> SWET_TRANSFORMERS_PURPLE = register("swet_transformers/purple"); + public static final TagKey> SWET_TRANSFORMERS_VERMILION = register("swet_transformers/vermilion"); - public static final Tag> VENOM_IMMUNITY = TagFactory.ENTITY_TYPE.create(Aether.locate("condition_immunities/venom")); - public static final Tag> ABSTENTINE_TOXICITY_IMMUNITY = TagFactory.ENTITY_TYPE.create(Aether.locate("condition_immunities/abstentine_toxicity")); - public static final Tag> BLOODTINGE_IMMUNITY = TagFactory.ENTITY_TYPE.create(Aether.locate("condition_immunities/bloodtinge")); - public static final Tag> ENTRANCEMENT_IMMUNITY = TagFactory.ENTITY_TYPE.create(Aether.locate("condition_immunities/entrancement")); - public static final Tag> FROSTBITE_IMMUNITY = TagFactory.ENTITY_TYPE.create(Aether.locate("condition_immunities/frostbite")); + public static final TagKey> VENOM_IMMUNITY = register("condition_immunities/venom"); + public static final TagKey> ABSTENTINE_TOXICITY_IMMUNITY = register("condition_immunities/abstentine_toxicity"); + public static final TagKey> BLOODTINGE_IMMUNITY = register("condition_immunities/bloodtinge"); + public static final TagKey> ENTRANCEMENT_IMMUNITY = register("condition_immunities/entrancement"); + public static final TagKey> FROSTBITE_IMMUNITY = register("condition_immunities/frostbite"); + + private static TagKey> register(String id) { + return TagKey.of(Registry.ENTITY_TYPE_KEY, Aether.locate(id)); + } } diff --git a/src/main/java/net/id/aether/tag/AetherFluidTags.java b/src/main/java/net/id/aether/tag/AetherFluidTags.java index b5b061e33..f353238b4 100644 --- a/src/main/java/net/id/aether/tag/AetherFluidTags.java +++ b/src/main/java/net/id/aether/tag/AetherFluidTags.java @@ -1,14 +1,18 @@ package net.id.aether.tag; -import net.fabricmc.fabric.api.tag.TagFactory; import net.id.aether.Aether; import net.minecraft.fluid.Fluid; -import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.registry.Registry; public class AetherFluidTags { - public static final Tag SWET_TRANSFORMERS_BLUE = TagFactory.FLUID.create(Aether.locate("swet_transformers/blue")); - public static final Tag SWET_TRANSFORMERS_GOLDEN = TagFactory.FLUID.create(Aether.locate("swet_transformers/golden")); - public static final Tag SWET_TRANSFORMERS_PURPLE = TagFactory.FLUID.create(Aether.locate("swet_transformers/purple")); - public static final Tag SWET_TRANSFORMERS_VERMILION = TagFactory.FLUID.create(Aether.locate("swet_transformers/vermilion")); - public static final Tag SPRING_WATER = TagFactory.FLUID.create(Aether.locate("spring_water")); + public static final TagKey SWET_TRANSFORMERS_BLUE = register("swet_transformers/blue"); + public static final TagKey SWET_TRANSFORMERS_GOLDEN = register("swet_transformers/golden"); + public static final TagKey SWET_TRANSFORMERS_PURPLE = register("swet_transformers/purple"); + public static final TagKey SWET_TRANSFORMERS_VERMILION = register("swet_transformers/vermilion"); + public static final TagKey SPRING_WATER = register("spring_water"); + + private static TagKey register(String id) { + return TagKey.of(Registry.FLUID_KEY, Aether.locate(id)); + } } diff --git a/src/main/java/net/id/aether/tag/AetherItemTags.java b/src/main/java/net/id/aether/tag/AetherItemTags.java index ac2d90f5f..64ce01df7 100644 --- a/src/main/java/net/id/aether/tag/AetherItemTags.java +++ b/src/main/java/net/id/aether/tag/AetherItemTags.java @@ -1,18 +1,22 @@ package net.id.aether.tag; -import net.fabricmc.fabric.api.tag.TagFactory; import net.id.aether.Aether; import net.minecraft.item.Item; -import net.minecraft.tag.Tag; +import net.minecraft.tag.TagKey; +import net.minecraft.util.registry.Registry; public class AetherItemTags { - public static final Tag GROWS_SWETS = TagFactory.ITEM.create(Aether.locate("grows_swets")); - public static final Tag SWET_TRANSFORMERS_BLUE = TagFactory.ITEM.create(Aether.locate("swet_transformers/blue")); - public static final Tag SWET_TRANSFORMERS_GOLDEN = TagFactory.ITEM.create(Aether.locate("swet_transformers/golden")); - public static final Tag SWET_TRANSFORMERS_PURPLE = TagFactory.ITEM.create(Aether.locate("swet_transformers/purple")); - public static final Tag SWET_TRANSFORMERS_VERMILION = TagFactory.ITEM.create(Aether.locate("swet_transformers/vermilion")); - public static final Tag PARACHUTES = TagFactory.ITEM.create(Aether.locate("parachutes")); - public static final Tag MOA_TEMPTABLES = TagFactory.ITEM.create(Aether.locate("entity/moa_temptables")); - public static final Tag RIGHTEOUS_WEAPONS = TagFactory.ITEM.create(Aether.locate("tool/righteous_weapons")); - public static final Tag SACRED_WEAPONS = TagFactory.ITEM.create(Aether.locate("tool/sacred_weapons")); + public static final TagKey GROWS_SWETS = register("grows_swets"); + public static final TagKey SWET_TRANSFORMERS_BLUE = register("swet_transformers/blue"); + public static final TagKey SWET_TRANSFORMERS_GOLDEN = register("swet_transformers/golden"); + public static final TagKey SWET_TRANSFORMERS_PURPLE = register("swet_transformers/purple"); + public static final TagKey SWET_TRANSFORMERS_VERMILION = register("swet_transformers/vermilion"); + public static final TagKey PARACHUTES = register("parachutes"); + public static final TagKey MOA_TEMPTABLES = register("entity/moa_temptables"); + public static final TagKey RIGHTEOUS_WEAPONS = register("tool/righteous_weapons"); + public static final TagKey SACRED_WEAPONS = register("tool/sacred_weapons"); + + private static TagKey register(String id) { + return TagKey.of(Registry.ITEM_KEY, Aether.locate(id)); + } } diff --git a/src/main/java/net/id/aether/world/dimension/AetherBiomes.java b/src/main/java/net/id/aether/world/dimension/AetherBiomes.java index 367fece09..a604f0b3d 100644 --- a/src/main/java/net/id/aether/world/dimension/AetherBiomes.java +++ b/src/main/java/net/id/aether/world/dimension/AetherBiomes.java @@ -6,6 +6,7 @@ import net.minecraft.entity.SpawnGroup; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.util.registry.RegistryKey; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.BiomeEffects; @@ -41,13 +42,13 @@ public final class AetherBiomes { public static final RegistryKey CONTINENTAL_PLATEAU_KEY = register("continental_plateau"); public static final RegistryKey HIGHLANDS_SHIELD_KEY = register("highlands_shield"); - public static final Biome HIGHLANDS_PLAINS; - public static final Biome HIGHLANDS_FOREST; - public static final Biome HIGHLANDS_THICKET; - public static final Biome WISTERIA_WOODS; - public static final Biome AUTUMNAL_TUNDRA; - public static final Biome CONTINENTAL_PLATEAU; - public static final Biome HIGHLANDS_SHIELD; + public static final RegistryEntry HIGHLANDS_PLAINS; + public static final RegistryEntry HIGHLANDS_FOREST; + public static final RegistryEntry HIGHLANDS_THICKET; + public static final RegistryEntry WISTERIA_WOODS; + public static final RegistryEntry AUTUMNAL_TUNDRA; + public static final RegistryEntry CONTINENTAL_PLATEAU; + public static final RegistryEntry HIGHLANDS_SHIELD; static{ HIGHLANDS_PLAINS = register(HIGHLANDS_PLAINS_KEY, createHighlandsPlains()); @@ -65,8 +66,8 @@ private static RegistryKey register(String name) { return RegistryKey.of(Registry.BIOME_KEY, locate(name)); } - private static Biome register(RegistryKey key, Biome biome) { - return BuiltinRegistries.set(BuiltinRegistries.BIOME, key, biome); + private static RegistryEntry register(RegistryKey key, Biome biome) { + return BuiltinRegistries.add(BuiltinRegistries.BIOME, key, biome); } /** @@ -115,7 +116,7 @@ private static BiomeEffects createBiomeEffects(int skyColor, int foliageColor, i * @param features The features to use * @return The new {@link GenerationSettings} instance */ - private static GenerationSettings createGenerationSettings(Map>> carvers, Map> features) { + private static GenerationSettings createGenerationSettings(Map>>> carvers, Map>> features) { var builder = new GenerationSettings.Builder(); for (var step : GenerationStep.Carver.values()) { for (var carver : carvers.getOrDefault(step, List.of())) { @@ -190,7 +191,7 @@ public static Map> mergeFeatures(Map>... maps){ * * @return The default Aether carvers */ - private static Map>> getAetherCarvers() { + private static Map>>> getAetherCarvers() { return Map.of(GenerationStep.Carver.AIR, List.of( ConfiguredCarvers.CAVE, AetherCarvers.LARGE_COLD_AERCLOUD_CARVER, @@ -210,7 +211,7 @@ private static Map>> getAetherCa * * @return A map of features suitable for use with {@link #createGenerationSettings} */ - private static Map> getStandardAetherFeatures() { + private static Map>> getStandardAetherFeatures() { return Map.of( GenerationStep.Feature.UNDERGROUND_ORES, List.of( ORE_AMBROSIUM, diff --git a/src/main/java/net/id/aether/world/feature/configured_features/AetherConfiguredFeatures.java b/src/main/java/net/id/aether/world/feature/configured_features/AetherConfiguredFeatures.java index 213d5f6d9..de9b4ecbe 100644 --- a/src/main/java/net/id/aether/world/feature/configured_features/AetherConfiguredFeatures.java +++ b/src/main/java/net/id/aether/world/feature/configured_features/AetherConfiguredFeatures.java @@ -3,9 +3,13 @@ import net.id.aether.world.feature.placed_features.AetherPlacedFeatures; import net.minecraft.block.Block; import net.minecraft.block.BlockState; +import net.minecraft.predicate.BlockPredicate; +import net.minecraft.util.Identifier; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; import net.minecraft.world.gen.stateprovider.BlockStateProvider; import java.util.List; @@ -18,8 +22,12 @@ */ @SuppressWarnings("unused") public class AetherConfiguredFeatures { - protected static ConfiguredFeature register(String id, ConfiguredFeature configuredFeature) { - return Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, locate(id), configuredFeature); + protected static > RegistryEntry> register(String id, F feature, FC featureConfig) { + return register(BuiltinRegistries.CONFIGURED_FEATURE, id, new ConfiguredFeature<>(feature, featureConfig)); + } + + private static RegistryEntry register(Registry registry, String id, V value) { + return (RegistryEntry) BuiltinRegistries.add(registry, locate(id), value); } public static void init() { @@ -38,15 +46,28 @@ static RandomPatchFeatureConfig blockPatch(int tries, int hSpread, int ySpread, static RandomPatchFeatureConfig blockPatch(int tries, int hSpread, int ySpread, BlockStateProvider provider){ return new RandomPatchFeatureConfig( tries, hSpread, ySpread, - () -> singleBlock(provider).withPlacement(AetherPlacedFeatures.ON_SOLID_GROUND) + singleBlock(provider, AetherPlacedFeatures.ON_SOLID_GROUND) ); } - static ConfiguredFeature singleBlock(BlockStateProvider provider){ - return Feature.SIMPLE_BLOCK.configure(new SimpleBlockFeatureConfig(provider)); + static SimpleBlockFeatureConfig singleBlockConfig(BlockStateProvider provider){ + return new SimpleBlockFeatureConfig(provider); + } + static SimpleBlockFeatureConfig singleBlockConfig(Block block){ + return singleBlockConfig(BlockStateProvider.of(block)); + } + static RegistryEntry singleBlock(BlockStateProvider provider){ + return PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, singleBlockConfig(provider)); } - static ConfiguredFeature singleBlock(Block block){ + static RegistryEntry singleBlock(Block block){ return singleBlock(BlockStateProvider.of(block)); } + + static RegistryEntry singleBlock(BlockStateProvider provider, PlacementModifier... modifiers){ + return PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(provider), modifiers); + } + static RegistryEntry singleBlock(Block block, PlacementModifier... modifiers){ + return singleBlock(BlockStateProvider.of(block), modifiers); + } // TODO This is incorrect, also convert this to tag final static List GENERIC_FLOOR_WHITELIST = List.of(AETHER_GRASS_BLOCK.getDefaultState(), COARSE_AETHER_DIRT.getDefaultState(), HOLYSTONE.getDefaultState(), COBBLED_HOLYSTONE.getDefaultState()); diff --git a/src/main/java/net/id/aether/world/feature/configured_features/AetherMiscConfiguredFeatures.java b/src/main/java/net/id/aether/world/feature/configured_features/AetherMiscConfiguredFeatures.java index 2d55be2a9..9a3dcabfc 100644 --- a/src/main/java/net/id/aether/world/feature/configured_features/AetherMiscConfiguredFeatures.java +++ b/src/main/java/net/id/aether/world/feature/configured_features/AetherMiscConfiguredFeatures.java @@ -1,6 +1,5 @@ package net.id.aether.world.feature.configured_features; -import com.google.common.collect.ImmutableSet; import net.id.aether.world.feature.AetherFeatures; import net.id.aether.world.feature.configs.BoulderFeatureConfig; import net.id.aether.world.feature.configs.GroundcoverFeatureConfig; @@ -18,8 +17,10 @@ import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.IntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider; -import net.minecraft.world.gen.decorator.BlockFilterPlacementModifier; +import net.minecraft.util.registry.RegistryEntry; +import net.minecraft.util.registry.RegistryEntryList; import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.BlockFilterPlacementModifier; import net.minecraft.world.gen.stateprovider.BlockStateProvider; import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; @@ -32,43 +33,45 @@ public class AetherMiscConfiguredFeatures extends AetherConfiguredFeatures{ Highlands */ // Default - public static final ConfiguredFeature QUICKSOIL = register("quicksoil", AetherFeatures.QUICKSOIL.configure(Configs.QUICKSOIL_CONFIG)); - public static final ConfiguredFeature WATER_SPRING = register("water_spring", Feature.SPRING_FEATURE.configure(Configs.WATER_SPRING_CONFIG)); + public static final RegistryEntry> QUICKSOIL = register("quicksoil", AetherFeatures.QUICKSOIL, Configs.QUICKSOIL_CONFIG); + public static final RegistryEntry> WATER_SPRING = register("water_spring", Feature.SPRING_FEATURE, Configs.WATER_SPRING_CONFIG); - public static final ConfiguredFeature GENERIC_BOULDER = register("generic_boulder", AetherFeatures.BOULDER.configure(Configs.GENERIC_BOULDER_CONFIG)); - public static final ConfiguredFeature PLAINS_BOULDER = register("plains_boulder", AetherFeatures.BOULDER.configure(Configs.PLAINS_BOULDER_CONFIG)); - public static final ConfiguredFeature THICKET_BOULDER = register("thicket_boulder", AetherFeatures.BOULDER.configure(Configs.THICKET_BOULDER_CONFIG)); - public static final ConfiguredFeature GOLDEN_BOULDER = register("golden_boulder", AetherFeatures.BOULDER.configure(Configs.GOLDEN_BOULDER_CONFIG)); + public static final RegistryEntry> GENERIC_BOULDER = register("generic_boulder", AetherFeatures.BOULDER, Configs.GENERIC_BOULDER_CONFIG); + public static final RegistryEntry> PLAINS_BOULDER = register("plains_boulder", AetherFeatures.BOULDER, Configs.PLAINS_BOULDER_CONFIG); + public static final RegistryEntry> THICKET_BOULDER = register("thicket_boulder", AetherFeatures.BOULDER, Configs.THICKET_BOULDER_CONFIG); + public static final RegistryEntry> GOLDEN_BOULDER = register("golden_boulder", AetherFeatures.BOULDER, Configs.GOLDEN_BOULDER_CONFIG); - public static final ConfiguredFeature ORE_AMBROSIUM = register("ore_ambrosium", Feature.ORE.configure(Configs.ore(AMBROSIUM_ORE, 14))); - public static final ConfiguredFeature ORE_GRAVITITE = register("ore_gravitite", Feature.ORE.configure(Configs.ore(GRAVITITE_ORE, 6))); - public static final ConfiguredFeature ORE_ZANITE = register("ore_zanite", Feature.ORE.configure(Configs.ore(ZANITE_ORE, 9))); + public static final RegistryEntry> ORE_AMBROSIUM = register("ore_ambrosium", Feature.ORE, Configs.ore(AMBROSIUM_ORE, 14)); + public static final RegistryEntry> ORE_GRAVITITE = register("ore_gravitite", Feature.ORE, Configs.ore(GRAVITITE_ORE, 6)); + public static final RegistryEntry> ORE_ZANITE = register("ore_zanite", Feature.ORE, Configs.ore(ZANITE_ORE, 9)); // Plato // Shield - public static final ConfiguredFeature SHIELD_ROCKS = register("shield_rocks", Feature.RANDOM_PATCH.configure(Configs.SHIELD_ROCKS_CONFIG)); + public static final RegistryEntry> SHIELD_ROCKS = register("shield_rocks", Feature.RANDOM_PATCH, Configs.SHIELD_ROCKS_CONFIG); - public static final ConfiguredFeature SHIELD_PONDS = register("shield_pond", AetherFeatures.AETHER_DELTA_FEATURE.configure(new DeltaFeatureConfig(Blocks.WATER.getDefaultState(), COBBLED_HOLYSTONE_SLAB.getDefaultState().with(SlabBlock.TYPE, SlabType.BOTTOM).with(Properties.WATERLOGGED, true), UniformIntProvider.create(2, 7), UniformIntProvider.create(1, 2)))); + public static final RegistryEntry> SHIELD_PONDS = register("shield_pond", AetherFeatures.AETHER_DELTA_FEATURE, new DeltaFeatureConfig(Blocks.WATER.getDefaultState(), COBBLED_HOLYSTONE_SLAB.getDefaultState().with(SlabBlock.TYPE, SlabType.BOTTOM).with(Properties.WATERLOGGED, true), UniformIntProvider.create(2, 7), UniformIntProvider.create(1, 2))); - public static final ConfiguredFeature SHIELD_STONE = register("shield_stone", AetherFeatures.GROUNDCOVER_FEATURE.configure(new GroundcoverFeatureConfig(new WeightedBlockStateProvider(DataPool.builder().add(HOLYSTONE.getDefaultState(), 7).add(COBBLED_HOLYSTONE.getDefaultState(), 5).add(MOSSY_HOLYSTONE.getDefaultState(), 2).build()), UniformIntProvider.create(1, 4), UniformIntProvider.create(0, 0)))); - public static final ConfiguredFeature SHIELD_PODZOL = register("shield_podzol", AetherFeatures.GROUNDCOVER_FEATURE.configure(new GroundcoverFeatureConfig(BlockStateProvider.of(AETHER_FROZEN_GRASS), UniformIntProvider.create(2, 3), UniformIntProvider.create(0, 0)))); + public static final RegistryEntry> SHIELD_STONE = register("shield_stone", AetherFeatures.GROUNDCOVER_FEATURE, new GroundcoverFeatureConfig(new WeightedBlockStateProvider(DataPool.builder().add(HOLYSTONE.getDefaultState(), 7).add(COBBLED_HOLYSTONE.getDefaultState(), 5).add(MOSSY_HOLYSTONE.getDefaultState(), 2).build()), UniformIntProvider.create(1, 4), UniformIntProvider.create(0, 0))); + public static final RegistryEntry> SHIELD_PODZOL = register("shield_podzol", AetherFeatures.GROUNDCOVER_FEATURE, new GroundcoverFeatureConfig(BlockStateProvider.of(AETHER_FROZEN_GRASS), UniformIntProvider.create(2, 3), UniformIntProvider.create(0, 0))); // Tundra - public static final ConfiguredFeature TUNDRA_SPIRES = register("tundra_spires", AetherFeatures.ICESTONE_SPIRE_FEATURE.configure(FeatureConfig.DEFAULT)); + public static final RegistryEntry> TUNDRA_SPIRES = register("tundra_spires", AetherFeatures.ICESTONE_SPIRE_FEATURE, FeatureConfig.DEFAULT); - public static final ConfiguredFeature TUNDRA_PONDS = register("tundra_pond", AetherFeatures.AETHER_DELTA_FEATURE.configure(new DeltaFeatureConfig(Blocks.ICE.getDefaultState(), Blocks.PACKED_ICE.getDefaultState(), UniformIntProvider.create(4, 9), UniformIntProvider.create(0, 1)))); - public static final ConfiguredFeature TUNDRA_SNOW = register("tundra_snow", AetherFeatures.AETHER_DELTA_FEATURE.configure(new DeltaFeatureConfig(Blocks.POWDER_SNOW.getDefaultState(), Blocks.SNOW_BLOCK.getDefaultState(), UniformIntProvider.create(3, 8), UniformIntProvider.create(0, 1)))); + public static final RegistryEntry> TUNDRA_PONDS = register("tundra_pond", AetherFeatures.AETHER_DELTA_FEATURE, new DeltaFeatureConfig(Blocks.ICE.getDefaultState(), Blocks.PACKED_ICE.getDefaultState(), UniformIntProvider.create(4, 9), UniformIntProvider.create(0, 1))); + public static final RegistryEntry> TUNDRA_SNOW = register("tundra_snow", AetherFeatures.AETHER_DELTA_FEATURE, new DeltaFeatureConfig(Blocks.POWDER_SNOW.getDefaultState(), Blocks.SNOW_BLOCK.getDefaultState(), UniformIntProvider.create(3, 8), UniformIntProvider.create(0, 1))); - public static final ConfiguredFeature FREEZE_AETHER_TOP_LAYER = register("freeze_aether_top_layer", AetherFeatures.FREEZE_AETHER_TOP_LAYER_FEATURE_FEATURE.configure(FeatureConfig.DEFAULT)); + public static final RegistryEntry> FREEZE_AETHER_TOP_LAYER = register("freeze_aether_top_layer", AetherFeatures.FREEZE_AETHER_TOP_LAYER_FEATURE_FEATURE, FeatureConfig.DEFAULT); + + // TODO 1.7 uncomment public static final RegistryEntry> AETHER_LAKE = register("aether_lake", AetherFeatures.AETHER_LAKE, new DynamicConfiguration(Blocks.WATER.getDefaultState(), Optional.of("normal"))); private static class Configs extends AetherConfiguredFeatures.Configs{ private static final QuicksoilConfig QUICKSOIL_CONFIG = new QuicksoilConfig(); - private static final SpringFeatureConfig WATER_SPRING_CONFIG = new SpringFeatureConfig(Fluids.WATER.getDefaultState(), true, 4, 1, ImmutableSet.of(HOLYSTONE)); + private static final SpringFeatureConfig WATER_SPRING_CONFIG = new SpringFeatureConfig(Fluids.WATER.getDefaultState(), true, 4, 1, RegistryEntryList.of(Block::getRegistryEntry, HOLYSTONE)); - private static final RandomPatchFeatureConfig SHIELD_ROCKS_CONFIG = new RandomPatchFeatureConfig(48, 9, 3, () -> Feature.SIMPLE_BLOCK.configure(new SimpleBlockFeatureConfig(new WeightedBlockStateProvider( + private static final RandomPatchFeatureConfig SHIELD_ROCKS_CONFIG = new RandomPatchFeatureConfig(48, 9, 3, PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(new WeightedBlockStateProvider( DataPool.builder() .add(COBBLED_HOLYSTONE_SLAB.getDefaultState().with(SlabBlock.TYPE, SlabType.BOTTOM), 10) .add(COBBLED_HOLYSTONE.getDefaultState(), 4) .build()) - )).withPlacement(BlockFilterPlacementModifier.of(AetherPlacedFeatures.IN_OR_ON_GROUND))); + ), BlockFilterPlacementModifier.of(AetherPlacedFeatures.IN_OR_ON_GROUND))); private static BoulderFeatureConfig boulder(BlockStateProvider provider, int tries, IntProvider size){ return new BoulderFeatureConfig(BlockStateProvider.of(COBBLED_HOLYSTONE), ConstantIntProvider.create(tries), size); diff --git a/src/main/java/net/id/aether/world/feature/configured_features/AetherTreeConfiguredFeatures.java b/src/main/java/net/id/aether/world/feature/configured_features/AetherTreeConfiguredFeatures.java index 931fcc02d..9f4a25d50 100644 --- a/src/main/java/net/id/aether/world/feature/configured_features/AetherTreeConfiguredFeatures.java +++ b/src/main/java/net/id/aether/world/feature/configured_features/AetherTreeConfiguredFeatures.java @@ -16,6 +16,7 @@ import net.minecraft.util.math.floatprovider.ConstantFloatProvider; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.*; import net.minecraft.world.gen.feature.size.FeatureSize; import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; @@ -33,55 +34,51 @@ public class AetherTreeConfiguredFeatures extends AetherConfiguredFeatures{ // Default - public static final ConfiguredFeature SKYROOT_TREE = register("skyroot_tree", configure(Configs.SKYROOT_CONFIG)); - public static final ConfiguredFeature GOLDEN_OAK_TREE = register("golden_oak_tree", configure(Configs.GOLDEN_OAK_CONFIG)); - public static final ConfiguredFeature CRYSTAL_TREE = register("crystal_tree", configure(Configs.CRYSTAL_TREE_CONFIG)); - public static final ConfiguredFeature ORANGE_TREE = register("orange_tree", configure(Configs.ORANGE_TREE_SAPLING_CONFIG)); + public static final RegistryEntry> SKYROOT_TREE = register("skyroot_tree", Feature.TREE, Configs.SKYROOT_CONFIG); + public static final RegistryEntry> GOLDEN_OAK_TREE = register("golden_oak_tree", Feature.TREE, Configs.GOLDEN_OAK_CONFIG); + public static final RegistryEntry> CRYSTAL_TREE = register("crystal_tree", Feature.TREE, Configs.CRYSTAL_TREE_CONFIG); + public static final RegistryEntry> ORANGE_TREE = register("orange_tree", Feature.TREE, Configs.ORANGE_TREE_SAPLING_CONFIG); // Wisteria - public static final ConfiguredFeature ROSE_WISTERIA_TREE = register("rose_wisteria_tree", configure(Configs.ROSE_WISTERIA_CONFIG)); - public static final ConfiguredFeature LAVENDER_WISTERIA_TREE = register("lavender_wisteria_tree", configure(Configs.LAVENDER_WISTERIA_CONFIG)); - public static final ConfiguredFeature FROST_WISTERIA_TREE = register("frost_wisteria_tree", configure(Configs.FROST_WISTERIA_CONFIG)); - public static final ConfiguredFeature BOREAL_WISTERIA_TREE = register("boreal_wisteria_tree", configure(Configs.BOREAL_WISTERIA_CONFIG)); + public static final RegistryEntry> ROSE_WISTERIA_TREE = register("rose_wisteria_tree", Feature.TREE, Configs.ROSE_WISTERIA_CONFIG); + public static final RegistryEntry> LAVENDER_WISTERIA_TREE = register("lavender_wisteria_tree", Feature.TREE, Configs.LAVENDER_WISTERIA_CONFIG); + public static final RegistryEntry> FROST_WISTERIA_TREE = register("frost_wisteria_tree", Feature.TREE, Configs.FROST_WISTERIA_CONFIG); + public static final RegistryEntry> BOREAL_WISTERIA_TREE = register("boreal_wisteria_tree", Feature.TREE, Configs.BOREAL_WISTERIA_CONFIG); // Variants - public static final ConfiguredFeature WILD_ORANGE_TREE = register("wild_orange_tree", configure(Configs.ORANGE_TREE_WILD_CONFIG)); - public static final ConfiguredFeature SKYROOT_SHRUB = register("skyroot_shrub", configure(Configs.SKYROOT_SHRUB_CONFIG)); - public static final ConfiguredFeature MOTTLED_SKYROOT = register("mottled_skyroot_tree", configure(Configs.MOTTLED_SKYROOT_CONFIG)); - public static final ConfiguredFeature DWARF_MOTTLED_SKYROOT = register("dwarf_mottled_skyroot_tree", configure(Configs.DWARF_MOTTLED_SKYROOT_CONFIG)); + public static final RegistryEntry> WILD_ORANGE_TREE = register("wild_orange_tree", Feature.TREE, Configs.ORANGE_TREE_WILD_CONFIG); + public static final RegistryEntry> SKYROOT_SHRUB = register("skyroot_shrub", Feature.TREE, Configs.SKYROOT_SHRUB_CONFIG); + public static final RegistryEntry> MOTTLED_SKYROOT = register("mottled_skyroot_tree", Feature.TREE, Configs.MOTTLED_SKYROOT_CONFIG); + public static final RegistryEntry> DWARF_MOTTLED_SKYROOT = register("dwarf_mottled_skyroot_tree", Feature.TREE, Configs.DWARF_MOTTLED_SKYROOT_CONFIG); // Fancy - public static final ConfiguredFeature FANCY_ROSE_WISTERIA_TREE = register("fancy_rose_wisteria_tree", configure(Configs.FANCY_ROSE_WISTERIA_CONFIG)); - public static final ConfiguredFeature FANCY_LAVENDER_WISTERIA_TREE = register("fancy_lavender_wisteria_tree", configure(Configs.FANCY_LAVENDER_WISTERIA_CONFIG)); - public static final ConfiguredFeature FANCY_FROST_WISTERIA_TREE = register("fancy_frost_wisteria_tree", configure(Configs.FANCY_FROST_WISTERIA_CONFIG)); - public static final ConfiguredFeature FANCY_BOREAL_WISTERIA_TREE = register("fancy_boreal_wisteria_tree", configure(Configs.FANCY_BOREAL_WISTERIA_CONFIG)); - public static final ConfiguredFeature FANCY_SKYROOT_TREE = register("fancy_skyroot_tree", configure(Configs.FANCY_SKYROOT_CONFIG)); + public static final RegistryEntry> FANCY_ROSE_WISTERIA_TREE = register("fancy_rose_wisteria_tree", Feature.TREE, Configs.FANCY_ROSE_WISTERIA_CONFIG); + public static final RegistryEntry> FANCY_LAVENDER_WISTERIA_TREE = register("fancy_lavender_wisteria_tree", Feature.TREE, Configs.FANCY_LAVENDER_WISTERIA_CONFIG); + public static final RegistryEntry> FANCY_FROST_WISTERIA_TREE = register("fancy_frost_wisteria_tree", Feature.TREE, Configs.FANCY_FROST_WISTERIA_CONFIG); + public static final RegistryEntry> FANCY_BOREAL_WISTERIA_TREE = register("fancy_boreal_wisteria_tree", Feature.TREE, Configs.FANCY_BOREAL_WISTERIA_CONFIG); + public static final RegistryEntry> FANCY_SKYROOT_TREE = register("fancy_skyroot_tree", Feature.TREE, Configs.FANCY_SKYROOT_CONFIG); // Crystal - public static final ConfiguredFeature CRYSTAL_TREE_ISLAND = register("crystal_tree_island", AetherFeatures.CRYSTAL_TREE_ISLAND.configure(Configs.DEFAULT_CONFIG)); + public static final RegistryEntry> CRYSTAL_TREE_ISLAND = register("crystal_tree_island", AetherFeatures.CRYSTAL_TREE_ISLAND, Configs.DEFAULT_CONFIG); // Fallen leaves - public static final ConfiguredFeature FALLEN_LEAVES = register("fallen_leaves", Feature.RANDOM_PATCH.configure(Configs.FALLEN_LEAVES_CONFIG)); - public static final ConfiguredFeature ALT_FALLEN_LEAVES = register("alt_fallen_leaves", Feature.RANDOM_PATCH.configure(Configs.FALLEN_LEAVES_CONFIG)); - public static final ConfiguredFeature FALLEN_ROSE_LEAVES = register("fallen_rose_leaves", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(new WeightedBlockStateProvider(DataPool.builder().add(ROSE_WISTERIA_LEAF_PILE.getDefaultState(), 10).add(ROSE_WISTERIA_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 2).build()), UniformIntProvider.create(4, 10), ConstantIntProvider.create(7), UniformIntProvider.create(3, 6), 1.2))); - public static final ConfiguredFeature FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(new WeightedBlockStateProvider(DataPool.builder().add(LAVENDER_WISTERIA_LEAF_PILE.getDefaultState(), 10).add(LAVENDER_WISTERIA_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 2).build()), UniformIntProvider.create(4, 10), ConstantIntProvider.create(7), UniformIntProvider.create(3, 6), 1.2))); - public static final ConfiguredFeature SHIELD_FALLEN_LEAVES = register("shield_fallen_leaves", Feature.RANDOM_PATCH.configure(Configs.FALLEN_LEAVES_CONFIG)); + public static final RegistryEntry> FALLEN_LEAVES = register("fallen_leaves", Feature.RANDOM_PATCH, Configs.FALLEN_LEAVES_CONFIG); + public static final RegistryEntry> ALT_FALLEN_LEAVES = register("alt_fallen_leaves", Feature.RANDOM_PATCH, Configs.FALLEN_LEAVES_CONFIG); + public static final RegistryEntry> FALLEN_ROSE_LEAVES = register("fallen_rose_leaves", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(new WeightedBlockStateProvider(DataPool.builder().add(ROSE_WISTERIA_LEAF_PILE.getDefaultState(), 10).add(ROSE_WISTERIA_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 2).build()), UniformIntProvider.create(4, 10), ConstantIntProvider.create(7), UniformIntProvider.create(3, 6), 1.2)); + public static final RegistryEntry> FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(new WeightedBlockStateProvider(DataPool.builder().add(LAVENDER_WISTERIA_LEAF_PILE.getDefaultState(), 10).add(LAVENDER_WISTERIA_LEAVES.getDefaultState().with(LeavesBlock.PERSISTENT, true), 2).build()), UniformIntProvider.create(4, 10), ConstantIntProvider.create(7), UniformIntProvider.create(3, 6), 1.2)); + public static final RegistryEntry> SHIELD_FALLEN_LEAVES = register("shield_fallen_leaves", Feature.RANDOM_PATCH, Configs.FALLEN_LEAVES_CONFIG); // Logs - public static final ConfiguredFeature THICKET_FALLEN_LOG = register("thicket_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE.configure(new LongFeatureConfig(UniformIntProvider.create(3, 6), BlockStateProvider.of(SKYROOT_LOG), BlockStateProvider.of(LIVERWORT_CARPET), BlockStateProvider.of(LIVERWORT_CARPET), 0.5F, 0.35F, Configs.GENERIC_FLOOR_WHITELIST))); + public static final RegistryEntry> THICKET_FALLEN_LOG = register("thicket_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 6), BlockStateProvider.of(SKYROOT_LOG), BlockStateProvider.of(LIVERWORT_CARPET), BlockStateProvider.of(LIVERWORT_CARPET), 0.5F, 0.35F, Configs.GENERIC_FLOOR_WHITELIST)); - public static final ConfiguredFeature MOTTLED_FALLEN_LOG = register("mottled_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE.configure(new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_SKYROOT_LOG), BlockStateProvider.of(AetherBlocks.AETHER_GRASS), BlockStateProvider.of(ROOTCAP), 0.3F, 0.15F, Configs.GENERIC_FLOOR_WHITELIST))); - public static final ConfiguredFeature MOTTLED_HOLLOW_FALLEN_LOG = register("mottled_hollow_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE.configure(new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(AETHER_GRASS_FLOWERING), BlockStateProvider.of(ROOTCAP), 0.4F, 0.25F, Configs.GENERIC_FLOOR_WHITELIST))); + public static final RegistryEntry> MOTTLED_FALLEN_LOG = register("mottled_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_SKYROOT_LOG), BlockStateProvider.of(AETHER_GRASS), BlockStateProvider.of(ROOTCAP), 0.3F, 0.15F, Configs.GENERIC_FLOOR_WHITELIST)); + public static final RegistryEntry> MOTTLED_HOLLOW_FALLEN_LOG = register("mottled_hollow_fallen_log", AetherFeatures.FALLEN_PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(3, 5), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(AETHER_GRASS_FLOWERING), BlockStateProvider.of(ROOTCAP), 0.4F, 0.25F, Configs.GENERIC_FLOOR_WHITELIST)); - public static final ConfiguredFeature SHIELD_STUMPS = register("shield_stumps", AetherFeatures.PILLAR_FEATURE.configure(new LongFeatureConfig(UniformIntProvider.create(1, 2), BlockStateProvider.of(MOTTLED_SKYROOT_LOG), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(ROOTCAP), 0.1F, 0.225F, Configs.GENERIC_FLOOR_WHITELIST))); - public static final ConfiguredFeature SHIELD_HOLLOW_STUMPS = register("shield_hollow_stumps", AetherFeatures.PILLAR_FEATURE.configure(new LongFeatureConfig(ConstantIntProvider.create(1), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(ROOTCAP), 0.015F, 0.3F, Configs.GENERIC_FLOOR_WHITELIST))); + public static final RegistryEntry> SHIELD_STUMPS = register("shield_stumps", AetherFeatures.PILLAR_FEATURE, new LongFeatureConfig(UniformIntProvider.create(1, 2), BlockStateProvider.of(MOTTLED_SKYROOT_LOG), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(ROOTCAP), 0.1F, 0.225F, Configs.GENERIC_FLOOR_WHITELIST)); + public static final RegistryEntry> SHIELD_HOLLOW_STUMPS = register("shield_hollow_stumps", AetherFeatures.PILLAR_FEATURE, new LongFeatureConfig(ConstantIntProvider.create(1), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(MOTTLED_SKYROOT_FALLEN_LOG), BlockStateProvider.of(ROOTCAP), 0.015F, 0.3F, Configs.GENERIC_FLOOR_WHITELIST)); // Assortments - public static final ConfiguredFeature SCATTERED_TREES = register("scattered_trees", Feature.RANDOM_SELECTOR.configure(Assortments.SCATTERED_TREES_CONFIG)); - public static final ConfiguredFeature SHIELD_TREES = register("shield_trees", Feature.RANDOM_SELECTOR.configure(Assortments.SHIELD_TREES_CONFIG)); - public static final ConfiguredFeature DENSE_SHIELD_TREES = register("dense_shield_trees", Feature.RANDOM_SELECTOR.configure(Assortments.DENSE_SHIELD_TREES_CONFIG)); - public static final ConfiguredFeature PLATEAU_TREES = register("plateau_trees", Feature.RANDOM_SELECTOR.configure(Assortments.PLATEAU_TREES_CONFIG)); - public static final ConfiguredFeature MIXED_TREES = register("mixed_trees", Feature.RANDOM_SELECTOR.configure(Assortments.MIXED_TREES_CONFIG)); - public static final ConfiguredFeature SPARSE_TREES = register("sparse_trees", Feature.RANDOM_SELECTOR.configure(Assortments.SPARSE_TREES_CONFIG)); - public static final ConfiguredFeature THICKET_TREES = register("thicket_trees", Feature.RANDOM_SELECTOR.configure(Assortments.THICKET_TREES_CONFIG)); - public static final ConfiguredFeature RAINBOW_FOREST_TREES = register("wisteria_woods_trees", Feature.RANDOM_SELECTOR.configure(Assortments.RAINBOW_FOREST_CONFIG)); - - private static ConfiguredFeature configure(TreeFeatureConfig cfg){ - return Feature.TREE.configure(cfg); - } + public static final RegistryEntry> SCATTERED_TREES = register("scattered_trees", Feature.RANDOM_SELECTOR, Assortments.SCATTERED_TREES_CONFIG); + public static final RegistryEntry> SHIELD_TREES = register("shield_trees", Feature.RANDOM_SELECTOR, Assortments.SHIELD_TREES_CONFIG); + public static final RegistryEntry> DENSE_SHIELD_TREES = register("dense_shield_trees", Feature.RANDOM_SELECTOR, Assortments.DENSE_SHIELD_TREES_CONFIG); + public static final RegistryEntry> PLATEAU_TREES = register("plateau_trees", Feature.RANDOM_SELECTOR, Assortments.PLATEAU_TREES_CONFIG); + public static final RegistryEntry> MIXED_TREES = register("mixed_trees", Feature.RANDOM_SELECTOR, Assortments.MIXED_TREES_CONFIG); + public static final RegistryEntry> SPARSE_TREES = register("sparse_trees", Feature.RANDOM_SELECTOR, Assortments.SPARSE_TREES_CONFIG); + public static final RegistryEntry> THICKET_TREES = register("thicket_trees", Feature.RANDOM_SELECTOR, Assortments.THICKET_TREES_CONFIG); + public static final RegistryEntry> RAINBOW_FOREST_TREES = register("wisteria_woods_trees", Feature.RANDOM_SELECTOR, Assortments.RAINBOW_FOREST_CONFIG); private static class Configs extends AetherConfiguredFeatures.Configs{ private static final DefaultFeatureConfig DEFAULT_CONFIG = new DefaultFeatureConfig(); @@ -312,11 +309,11 @@ private static TreeFeatureConfig generateTree(BlockStateProvider logProvider, Bl * This is a separate inner class to prevent things loading in the wrong order. */ public static class Assortments { - private static PlacedFeature placed(ConfiguredFeature feature, Block sapling) { - return feature.withWouldSurviveFilter(sapling); + private static RegistryEntry placed(RegistryEntry> feature, Block sapling) { + return PlacedFeatures.createEntry(feature, PlacedFeatures.wouldSurvive(sapling)); } - private static RandomFeatureEntry entry(ConfiguredFeature feature, Block sapling, float chance) { + private static RandomFeatureEntry entry(RegistryEntry> feature, Block sapling, float chance) { return new RandomFeatureEntry(placed(feature, sapling), chance); } diff --git a/src/main/java/net/id/aether/world/feature/configured_features/AetherVegetationConfiguredFeatures.java b/src/main/java/net/id/aether/world/feature/configured_features/AetherVegetationConfiguredFeatures.java index db0ac7990..7295abe96 100644 --- a/src/main/java/net/id/aether/world/feature/configured_features/AetherVegetationConfiguredFeatures.java +++ b/src/main/java/net/id/aether/world/feature/configured_features/AetherVegetationConfiguredFeatures.java @@ -11,12 +11,10 @@ import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.blockpredicate.BlockPredicate; -import net.minecraft.world.gen.decorator.BlockFilterPlacementModifier; -import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.DefaultFeatureConfig; -import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.RandomPatchFeatureConfig; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.BlockFilterPlacementModifier; import net.minecraft.world.gen.stateprovider.BlockStateProvider; import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; @@ -29,31 +27,31 @@ public class AetherVegetationConfiguredFeatures extends AetherConfiguredFeatures Highlands */ // Default - public static final ConfiguredFeature AETHER_BUSH = register("aether_bush", Feature.RANDOM_PATCH.configure(Configs.AETHER_BUSH_CONFIG)); - public static final ConfiguredFeature AETHER_DENSE_BUSH = register("aether_dense_bush", Feature.RANDOM_PATCH.configure(Configs.AETHER_DENSE_BUSH_CONFIG)); - public static final ConfiguredFeature AETHER_GRASS_BUSH = register("aether_grass", Feature.RANDOM_PATCH.configure(Configs.AETHER_GRASS_BUSH_CONFIG)); - public static final ConfiguredFeature AETHER_GRASS_BONEMEAL = register("aether_grass_bonemeal", Configs.singleBlock(AETHER_GRASS)); - public static final ConfiguredFeature AETHER_TALL_GRASS_BUSH = register("aether_tall_grass", Feature.RANDOM_PATCH.configure(Configs.AETHER_TALL_GRASS_BUSH_CONFIG)); - public static final ConfiguredFeature FLUTEGRASS = register("flutegrass", Feature.RANDOM_PATCH.configure(Configs.FLUTEGRASS_CONFIG)); - public static final ConfiguredFeature FLUTEGRASS_BONEMEAL = register("flutegrass_bonemeal", Configs.singleBlock(AetherBlocks.FLUTEGRASS)); - public static final ConfiguredFeature AETHER_FLOWERS = register("aether_flowers", Feature.FLOWER.configure(Configs.AETHER_FLOWER_CONFIG)); - public static final ConfiguredFeature PATCH_BLUEBERRY = register("patch_blueberry", Feature.RANDOM_PATCH.configure(Configs.BLUEBERRY_PATCH_CONFIG)); + public static final RegistryEntry> AETHER_BUSH = register("aether_bush", Feature.RANDOM_PATCH, Configs.AETHER_BUSH_CONFIG); + public static final RegistryEntry> AETHER_DENSE_BUSH = register("aether_dense_bush", Feature.RANDOM_PATCH, Configs.AETHER_DENSE_BUSH_CONFIG); + public static final RegistryEntry> AETHER_GRASS_BUSH = register("aether_grass", Feature.RANDOM_PATCH, Configs.AETHER_GRASS_BUSH_CONFIG); + public static final RegistryEntry> AETHER_GRASS_BONEMEAL = register("aether_grass_bonemeal", Feature.SIMPLE_BLOCK, Configs.singleBlockConfig(AETHER_GRASS)); + public static final RegistryEntry> AETHER_TALL_GRASS_BUSH = register("aether_tall_grass", Feature.RANDOM_PATCH, Configs.AETHER_TALL_GRASS_BUSH_CONFIG); + public static final RegistryEntry> FLUTEGRASS = register("flutegrass", Feature.RANDOM_PATCH, Configs.FLUTEGRASS_CONFIG); + public static final RegistryEntry> FLUTEGRASS_BONEMEAL = register("flutegrass_bonemeal", Feature.SIMPLE_BLOCK, Configs.singleBlockConfig(AetherBlocks.FLUTEGRASS)); + public static final RegistryEntry> AETHER_FLOWERS = register("aether_flowers", Feature.FLOWER, Configs.AETHER_FLOWER_CONFIG); + public static final RegistryEntry> PATCH_BLUEBERRY = register("patch_blueberry", Feature.RANDOM_PATCH, Configs.BLUEBERRY_PATCH_CONFIG); // Plato - public static final ConfiguredFeature PLATEAU_FOLIAGE = register("plateau_foliage", Feature.RANDOM_PATCH.configure(Configs.PLATEAU_FOLIAGE_CONFIG)); - public static final ConfiguredFeature PLATEAU_FLOWERING_GRASS = register("plateau_flowering_grass", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(BlockStateProvider.of(AETHER_GRASS_FLOWERING), UniformIntProvider.create(3, 10), ConstantIntProvider.create(5), UniformIntProvider.create(3, 6), 1.5))); - public static final ConfiguredFeature PLATEAU_SHAMROCK = register("plateau_shamrock", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.4))); + public static final RegistryEntry> PLATEAU_FOLIAGE = register("plateau_foliage", Feature.RANDOM_PATCH, Configs.PLATEAU_FOLIAGE_CONFIG); + public static final RegistryEntry> PLATEAU_FLOWERING_GRASS = register("plateau_flowering_grass", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(AETHER_GRASS_FLOWERING), UniformIntProvider.create(3, 10), ConstantIntProvider.create(5), UniformIntProvider.create(3, 6), 1.5)); + public static final RegistryEntry> PLATEAU_SHAMROCK = register("plateau_shamrock", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.4)); // Shield - public static final ConfiguredFeature SHIELD_FOLIAGE = register("shield_foliage", Feature.RANDOM_PATCH.configure(Configs.SHIELD_FOLIAGE_CONFIG)); - public static final ConfiguredFeature SHIELD_FLAX = register("shield_flax", Feature.RANDOM_PATCH.configure(Configs.SHIELD_FLAX_CONFIG)); - public static final ConfiguredFeature SHIELD_NETTLES = register("shield_nettles", AetherFeatures.HONEY_NETTLE_FEATURE.configure(new DefaultFeatureConfig())); + public static final RegistryEntry> SHIELD_FOLIAGE = register("shield_foliage", Feature.RANDOM_PATCH, Configs.SHIELD_FOLIAGE_CONFIG); + public static final RegistryEntry> SHIELD_FLAX = register("shield_flax", Feature.RANDOM_PATCH, Configs.SHIELD_FLAX_CONFIG); + public static final RegistryEntry> SHIELD_NETTLES = register("shield_nettles", AetherFeatures.HONEY_NETTLE_FEATURE, new DefaultFeatureConfig()); // Thicket - public static final ConfiguredFeature THICKET_LIVERWORT = register("thicket_liverwort", AetherFeatures.GROUNDCOVER_FEATURE.configure(new GroundcoverFeatureConfig(BlockStateProvider.of(LIVERWORT), UniformIntProvider.create(0, 2), UniformIntProvider.create(0, 1)))); - public static final ConfiguredFeature THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(BlockStateProvider.of(LIVERWORT_CARPET), UniformIntProvider.create(1, 4), ConstantIntProvider.create(5), UniformIntProvider.create(5, 8), 1.3))); - public static final ConfiguredFeature THICKET_SHAMROCK = register("thicket_shamrock", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(BlockStateProvider.of(SHAMROCK), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.3))); + public static final RegistryEntry> THICKET_LIVERWORT = register("thicket_liverwort", AetherFeatures.GROUNDCOVER_FEATURE, new GroundcoverFeatureConfig(BlockStateProvider.of(LIVERWORT), UniformIntProvider.create(0, 2), UniformIntProvider.create(0, 1))); + public static final RegistryEntry> THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(LIVERWORT_CARPET), UniformIntProvider.create(1, 4), ConstantIntProvider.create(5), UniformIntProvider.create(5, 8), 1.3)); + public static final RegistryEntry> THICKET_SHAMROCK = register("thicket_shamrock", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(SHAMROCK), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.3)); // Tundra - public static final ConfiguredFeature TUNDRA_FOLIAGE = register("tundra_foliage", Feature.RANDOM_PATCH.configure(Configs.TUNDRA_FOLIAGE_CONFIG)); + public static final RegistryEntry> TUNDRA_FOLIAGE = register("tundra_foliage", Feature.RANDOM_PATCH, Configs.TUNDRA_FOLIAGE_CONFIG); // ? - public static final ConfiguredFeature RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE.configure(new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(3, 13), ConstantIntProvider.create(5), UniformIntProvider.create(3, 4), 1.4))); + public static final RegistryEntry> RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", AetherFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(3, 13), ConstantIntProvider.create(5), UniformIntProvider.create(3, 4), 1.4)); private static class Configs extends AetherConfiguredFeatures.Configs{ @@ -95,7 +93,7 @@ private static class Configs extends AetherConfiguredFeatures.Configs{ )); private static final RandomPatchFeatureConfig SHIELD_FLAX_CONFIG = new RandomPatchFeatureConfig(96, 12, 5, - () -> singleBlock(WILD_FLAX).withPlacement(BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(List.of(HOLYSTONE, COBBLED_HOLYSTONE, MOSSY_HOLYSTONE), Vec3i.ZERO.down())), AetherPlacedFeatures.ON_SOLID_GROUND) + singleBlock(WILD_FLAX, BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(List.of(HOLYSTONE, COBBLED_HOLYSTONE, MOSSY_HOLYSTONE), Vec3i.ZERO.down())), AetherPlacedFeatures.ON_SOLID_GROUND) ); // Tundra private static final RandomPatchFeatureConfig TUNDRA_FOLIAGE_CONFIG = blockPatch(32, 7, 3, new WeightedBlockStateProvider( diff --git a/src/main/java/net/id/aether/world/feature/features/AetherLakeFeature.java b/src/main/java/net/id/aether/world/feature/features/AetherLakeFeature.java index 1654ecb26..b1ed4ffc4 100644 --- a/src/main/java/net/id/aether/world/feature/features/AetherLakeFeature.java +++ b/src/main/java/net/id/aether/world/feature/features/AetherLakeFeature.java @@ -8,10 +8,8 @@ import net.minecraft.block.Blocks; import net.minecraft.block.Material; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.ChunkSectionPos; import net.minecraft.world.LightType; import net.minecraft.world.gen.feature.Feature; -import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.util.FeatureContext; public class AetherLakeFeature extends Feature{ @@ -24,57 +22,111 @@ public class AetherLakeFeature extends Feature{ public AetherLakeFeature(Codec codec){ super(codec); } - + + // FIXME 1.18.2-pre1 public boolean generate(FeatureContext context){ BlockPos blockPos = context.getOrigin(); - - // Find the highest solid block or give up at a Y level of 60 - while(blockPos.getY() > 60 && context.getWorld().isAir(blockPos)){ - blockPos = blockPos.down(); - } - - if(blockPos.getY() <= 59){ + + if(blockPos.getY() <= 123 + context.getWorld().getBottomY()){ // Too low, didn't find a high enough block return false; }else{ // Move the position to the bottom of the lake blockPos = blockPos.down(4); - - // Bail if there is a village in the current chunk. - if(context.getWorld().getStructures(ChunkSectionPos.from(blockPos), StructureFeature.VILLAGE).stream().findAny().isPresent()){ - return false; - }else{ - boolean[] waterMap = new boolean[2048]; - int lakeSize = context.getRandom().nextInt(4) + 4; - - // Generate water map - for(int i = 0; i < lakeSize; i++){ - double xSize = context.getRandom().nextDouble() * 6.0D + 3.0D; - double ySize = context.getRandom().nextDouble() * 4.0D + 2.0D; - double zSize = context.getRandom().nextDouble() * 6.0D + 3.0D; - double xCenter = context.getRandom().nextDouble() * (16.0D - xSize - 2.0D) + 1.0D + xSize / 2.0D; - double yCenter = context.getRandom().nextDouble() * (8.0D - ySize - 4.0D) + 2.0D + ySize / 2.0D; - double zCenter = context.getRandom().nextDouble() * (16.0D - zSize - 2.0D) + 1.0D + zSize / 2.0D; - - for(int xOff = 1; xOff < 15; xOff++){ - for(int zOff = 1; zOff < 15; zOff++){ - for(int yOff = 1; yOff < 7; yOff++){ - double o = ((double)xOff - xCenter) / (xSize / 2.0D); - double p = ((double)yOff - yCenter) / (ySize / 2.0D); - double q = ((double)zOff - zCenter) / (zSize / 2.0D); - double r = o * o + p * p + q * q; - if(r < 1.0D){ - waterMap[(xOff * 16 + zOff) * 8 + yOff] = true; - } + + boolean[] waterMap = new boolean[2048]; + int lakeSize = context.getRandom().nextInt(4) + 4; + + // Generate water map + for(int i = 0; i < lakeSize; i++){ + double xSize = context.getRandom().nextDouble() * 6.0D + 3.0D; + double ySize = context.getRandom().nextDouble() * 4.0D + 2.0D; + double zSize = context.getRandom().nextDouble() * 6.0D + 3.0D; + double xCenter = context.getRandom().nextDouble() * (16.0D - xSize - 2.0D) + 1.0D + xSize / 2.0D; + double yCenter = context.getRandom().nextDouble() * (8.0D - ySize - 4.0D) + 2.0D + ySize / 2.0D; + double zCenter = context.getRandom().nextDouble() * (16.0D - zSize - 2.0D) + 1.0D + zSize / 2.0D; + + for(int xOff = 1; xOff < 15; xOff++){ + for(int zOff = 1; zOff < 15; zOff++){ + for(int yOff = 1; yOff < 7; yOff++){ + double o = ((double)xOff - xCenter) / (xSize / 2.0D); + double p = ((double)yOff - yCenter) / (ySize / 2.0D); + double q = ((double)zOff - zCenter) / (zSize / 2.0D); + double r = o * o + p * p + q * q; + if(r < 1.0D){ + waterMap[(xOff * 16 + zOff) * 8 + yOff] = true; + } + } + } + } + } + + for(int xOff = 0; xOff < 16; xOff++){ + for(int zOff = 0; zOff < 16; zOff++){ + for(int yOff = 0; yOff < 8; yOff++){ + //TODO Break this thing down some. + boolean lakeEdge = + !waterMap[(xOff * 16 + zOff) * 8 + yOff] && + ( + xOff < 15 && waterMap[((xOff + 1) * 16 + zOff) * 8 + yOff] || + xOff > 0 && waterMap[((xOff - 1) * 16 + zOff) * 8 + yOff] || + zOff < 15 && waterMap[(xOff * 16 + zOff + 1) * 8 + yOff] || + zOff > 0 && waterMap[(xOff * 16 + (zOff - 1)) * 8 + yOff] || + yOff < 7 && waterMap[(xOff * 16 + zOff) * 8 + yOff + 1] || + yOff > 0 && waterMap[(xOff * 16 + zOff) * 8 + (yOff - 1)] + ); + + if(lakeEdge){ + var state = context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)); + if(state.isOf(AetherBlocks.SKYROOT_LEAF_PILE)){ + System.out.flush(); + } + + Material material = state.getMaterial(); + // There is a liquid above the lake, abort + if(yOff >= 4 && material.isLiquid()){ + return false; + } + + // There is a non-solid, non-lake block on the edge, abort + if(yOff < 4 && !material.isSolid() && context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)) != context.getConfig().state){ + return false; + } + } + } + } + } + + // Fill the lake with fluid, including air + for(int xOff = 0; xOff < 16; xOff++){ + for(int zOff = 0; zOff < 16; zOff++){ + for(int yOff = 0; yOff < 8; yOff++){ + if(waterMap[(xOff * 16 + zOff) * 8 + yOff]){ + context.getWorld().setBlockState(blockPos.add(xOff, yOff, zOff), yOff >= 4 ? CAVE_AIR : context.getConfig().state, Block.NOTIFY_LISTENERS); + } + } + } + } + + // Replace soil that has access to any skylight with grass + for(int xOff = 0; xOff < 16; xOff++){ + for(int zOff = 0; zOff < 16; zOff++){ + for(int yOff = 4; yOff < 8; yOff++){ + if(waterMap[(xOff * 16 + zOff) * 8 + yOff]){ + var blockPos3 = blockPos.add(xOff, yOff - 1, zOff); + if(isSoil(context.getWorld().getBlockState(blockPos3)) && context.getWorld().getLightLevel(LightType.SKY, blockPos.add(xOff, yOff, zOff)) > 0){ + context.getWorld().setBlockState(blockPos3, AetherBlocks.AETHER_GRASS_BLOCK.getDefaultState(), Block.NOTIFY_LISTENERS); } } } } - + } + + // Replace 50% of lave lake edge blocks with holystone. + if(context.getConfig().state.getMaterial() == Material.LAVA){ for(int xOff = 0; xOff < 16; xOff++){ for(int zOff = 0; zOff < 16; zOff++){ for(int yOff = 0; yOff < 8; yOff++){ - //TODO Break this thing down some. boolean lakeEdge = !waterMap[(xOff * 16 + zOff) * 8 + yOff] && ( @@ -85,90 +137,27 @@ public boolean generate(FeatureContext context){ yOff < 7 && waterMap[(xOff * 16 + zOff) * 8 + yOff + 1] || yOff > 0 && waterMap[(xOff * 16 + zOff) * 8 + (yOff - 1)] ); - - if(lakeEdge){ - var state = context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)); - if(state.isOf(AetherBlocks.SKYROOT_LEAF_PILE)){ - System.out.flush(); - } - - Material material = state.getMaterial(); - // There is a liquid above the lake, abort - if(yOff >= 4 && material.isLiquid()){ - return false; - } - - // There is a non-solid, non-lake block on the edge, abort - if(yOff < 4 && !material.isSolid() && context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)) != context.getConfig().state){ - return false; - } - } - } - } - } - - // Fill the lake with fluid, including air - for(int xOff = 0; xOff < 16; xOff++){ - for(int zOff = 0; zOff < 16; zOff++){ - for(int yOff = 0; yOff < 8; yOff++){ - if(waterMap[(xOff * 16 + zOff) * 8 + yOff]){ - context.getWorld().setBlockState(blockPos.add(xOff, yOff, zOff), yOff >= 4 ? CAVE_AIR : context.getConfig().state, Block.NOTIFY_LISTENERS); + if(lakeEdge && (yOff < 4 || context.getRandom().nextInt(2) != 0) && context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)).getMaterial().isSolid()){ + context.getWorld().setBlockState(blockPos.add(xOff, yOff, zOff), AetherBlocks.HOLYSTONE.getDefaultState(), Block.NOTIFY_LISTENERS); } } } } - - // Replace soil that has access to any skylight with grass + } + + // Cover water lakes with ice in frozen biomes + if(context.getConfig().state.getMaterial() == Material.WATER){ for(int xOff = 0; xOff < 16; xOff++){ for(int zOff = 0; zOff < 16; zOff++){ - for(int yOff = 4; yOff < 8; yOff++){ - if(waterMap[(xOff * 16 + zOff) * 8 + yOff]){ - var blockPos3 = blockPos.add(xOff, yOff - 1, zOff); - if(isSoil(context.getWorld().getBlockState(blockPos3)) && context.getWorld().getLightLevel(LightType.SKY, blockPos.add(xOff, yOff, zOff)) > 0){ - context.getWorld().setBlockState(blockPos3, AetherBlocks.AETHER_GRASS_BLOCK.getDefaultState(), Block.NOTIFY_LISTENERS); - } - } - } - } - } - - // Replace 50% of lave lake edge blocks with holystone. - if(context.getConfig().state.getMaterial() == Material.LAVA){ - for(int xOff = 0; xOff < 16; xOff++){ - for(int zOff = 0; zOff < 16; zOff++){ - for(int yOff = 0; yOff < 8; yOff++){ - boolean lakeEdge = - !waterMap[(xOff * 16 + zOff) * 8 + yOff] && - ( - xOff < 15 && waterMap[((xOff + 1) * 16 + zOff) * 8 + yOff] || - xOff > 0 && waterMap[((xOff - 1) * 16 + zOff) * 8 + yOff] || - zOff < 15 && waterMap[(xOff * 16 + zOff + 1) * 8 + yOff] || - zOff > 0 && waterMap[(xOff * 16 + (zOff - 1)) * 8 + yOff] || - yOff < 7 && waterMap[(xOff * 16 + zOff) * 8 + yOff + 1] || - yOff > 0 && waterMap[(xOff * 16 + zOff) * 8 + (yOff - 1)] - ); - if(lakeEdge && (yOff < 4 || context.getRandom().nextInt(2) != 0) && context.getWorld().getBlockState(blockPos.add(xOff, yOff, zOff)).getMaterial().isSolid()){ - context.getWorld().setBlockState(blockPos.add(xOff, yOff, zOff), AetherBlocks.HOLYSTONE.getDefaultState(), Block.NOTIFY_LISTENERS); - } - } - } - } - } - - // Cover water lakes with ice in frozen biomes - if(context.getConfig().state.getMaterial() == Material.WATER){ - for(int xOff = 0; xOff < 16; xOff++){ - for(int zOff = 0; zOff < 16; zOff++){ - var blockPos3 = blockPos.add(xOff, 4, zOff); - if(context.getWorld().getBiome(blockPos3).canSetIce(context.getWorld(), blockPos3, false)){ - context.getWorld().setBlockState(blockPos3, Blocks.ICE.getDefaultState(), Block.NOTIFY_LISTENERS); - } + var blockPos3 = blockPos.add(xOff, 4, zOff); + if(context.getWorld().getBiome(blockPos3).value().canSetIce(context.getWorld(), blockPos3, false)){ + context.getWorld().setBlockState(blockPos3, Blocks.ICE.getDefaultState(), Block.NOTIFY_LISTENERS); } } } - - return true; } + + return true; } } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/features/FreezeAetherTopLayerFeature.java b/src/main/java/net/id/aether/world/feature/features/FreezeAetherTopLayerFeature.java index 678530412..fdf2d052a 100644 --- a/src/main/java/net/id/aether/world/feature/features/FreezeAetherTopLayerFeature.java +++ b/src/main/java/net/id/aether/world/feature/features/FreezeAetherTopLayerFeature.java @@ -49,7 +49,7 @@ public boolean generate(FeatureContext context) { floor.set(surface).move(Direction.DOWN, 1); - Biome biome = world.getBiome(surface); + Biome biome = world.getBiome(surface).value(); if (biome.canSetIce(world, floor, false)) { world.setBlockState(floor, Blocks.ICE.getDefaultState(), Block.NOTIFY_LISTENERS); } diff --git a/src/main/java/net/id/aether/world/feature/placed_features/AetherMiscPlacedFeatures.java b/src/main/java/net/id/aether/world/feature/placed_features/AetherMiscPlacedFeatures.java index bd9b1b8aa..12cc1f31b 100644 --- a/src/main/java/net/id/aether/world/feature/placed_features/AetherMiscPlacedFeatures.java +++ b/src/main/java/net/id/aether/world/feature/placed_features/AetherMiscPlacedFeatures.java @@ -3,40 +3,41 @@ import net.id.aether.world.feature.configured_features.AetherMiscConfiguredFeatures; import net.id.aether.world.feature.placement_modifiers.ChancePlacementModifier; import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.YOffset; -import net.minecraft.world.gen.decorator.*; import net.minecraft.world.gen.feature.PlacedFeature; import net.minecraft.world.gen.feature.PlacedFeatures; +import net.minecraft.world.gen.placementmodifier.*; public class AetherMiscPlacedFeatures extends AetherPlacedFeatures{ /* Highlands */ // Default - public static final PlacedFeature GENERIC_BOULDER = register("generic_boulder", AetherMiscConfiguredFeatures.GENERIC_BOULDER.withPlacement(ChancePlacementModifier.of(15), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)))); - public static final PlacedFeature PLAINS_BOULDER = register("plains_boulder", AetherMiscConfiguredFeatures.PLAINS_BOULDER.withPlacement(ChancePlacementModifier.of(8), CountMultilayerPlacementModifier.of(1))); - public static final PlacedFeature THICKET_BOULDER = register("thicket_boulder", AetherMiscConfiguredFeatures.THICKET_BOULDER.withPlacement(ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); - public static final PlacedFeature GOLDEN_BOULDER = register("golden_boulder", AetherMiscConfiguredFeatures.GOLDEN_BOULDER.withPlacement(ChancePlacementModifier.of(30), CountMultilayerPlacementModifier.of(1))); + public static final RegistryEntry GENERIC_BOULDER = register("generic_boulder", AetherMiscConfiguredFeatures.GENERIC_BOULDER, ChancePlacementModifier.of(15), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1))); + public static final RegistryEntry PLAINS_BOULDER = register("plains_boulder", AetherMiscConfiguredFeatures.PLAINS_BOULDER, ChancePlacementModifier.of(8), CountMultilayerPlacementModifier.of(1)); + public static final RegistryEntry THICKET_BOULDER = register("thicket_boulder", AetherMiscConfiguredFeatures.THICKET_BOULDER, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); + public static final RegistryEntry GOLDEN_BOULDER = register("golden_boulder", AetherMiscConfiguredFeatures.GOLDEN_BOULDER, ChancePlacementModifier.of(30), CountMultilayerPlacementModifier.of(1)); - public static final PlacedFeature QUICKSOIL = register("quicksoil", AetherMiscConfiguredFeatures.QUICKSOIL.withPlacement()); - public static final PlacedFeature WATER_SPRING = register("water_spring", AetherMiscConfiguredFeatures.WATER_SPRING.withPlacement()); + public static final RegistryEntry QUICKSOIL = register("quicksoil", AetherMiscConfiguredFeatures.QUICKSOIL); + public static final RegistryEntry WATER_SPRING = register("water_spring", AetherMiscConfiguredFeatures.WATER_SPRING); - public static final PlacedFeature ORE_AMBROSIUM = register("ore_ambrosium", AetherMiscConfiguredFeatures.ORE_AMBROSIUM.withPlacement(CountPlacementModifier.of(20), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(0), YOffset.aboveBottom(127)), BiomePlacementModifier.of())); - public static final PlacedFeature ORE_GRAVITITE = register("ore_gravitite", AetherMiscConfiguredFeatures.ORE_GRAVITITE.withPlacement(CountPlacementModifier.of(3), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(32), YOffset.aboveBottom(79)), BiomePlacementModifier.of())); - public static final PlacedFeature ORE_ZANITE = register("ore_zanite", AetherMiscConfiguredFeatures.ORE_ZANITE.withPlacement(CountPlacementModifier.of(16), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(0), YOffset.aboveBottom(128)), BiomePlacementModifier.of())); + public static final RegistryEntry ORE_AMBROSIUM = register("ore_ambrosium", AetherMiscConfiguredFeatures.ORE_AMBROSIUM, CountPlacementModifier.of(20), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(0), YOffset.aboveBottom(127)), BiomePlacementModifier.of()); + public static final RegistryEntry ORE_GRAVITITE = register("ore_gravitite", AetherMiscConfiguredFeatures.ORE_GRAVITITE, CountPlacementModifier.of(3), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(32), YOffset.aboveBottom(79)), BiomePlacementModifier.of()); + public static final RegistryEntry ORE_ZANITE = register("ore_zanite", AetherMiscConfiguredFeatures.ORE_ZANITE, CountPlacementModifier.of(16), SquarePlacementModifier.of(), HeightRangePlacementModifier.trapezoid(YOffset.aboveBottom(0), YOffset.aboveBottom(128)), BiomePlacementModifier.of()); // Plato // Shield - public static final PlacedFeature SHIELD_ROCKS = register("shield_rocks", AetherMiscConfiguredFeatures.SHIELD_ROCKS.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); + public static final RegistryEntry SHIELD_ROCKS = register("shield_rocks", AetherMiscConfiguredFeatures.SHIELD_ROCKS, PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); - public static final PlacedFeature SHIELD_PONDS = register("shield_pond", AetherMiscConfiguredFeatures.SHIELD_PONDS.withPlacement(CountMultilayerPlacementModifier.of(19))); + public static final RegistryEntry SHIELD_PONDS = register("shield_pond", AetherMiscConfiguredFeatures.SHIELD_PONDS, CountMultilayerPlacementModifier.of(19)); - public static final PlacedFeature SHIELD_STONE = register("shield_stone", AetherMiscConfiguredFeatures.SHIELD_STONE.withPlacement(CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); - public static final PlacedFeature SHIELD_PODZOL = register("shield_podzol", AetherMiscConfiguredFeatures.SHIELD_PODZOL.withPlacement(CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(15), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); + public static final RegistryEntry SHIELD_STONE = register("shield_stone", AetherMiscConfiguredFeatures.SHIELD_STONE, CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); + public static final RegistryEntry SHIELD_PODZOL = register("shield_podzol", AetherMiscConfiguredFeatures.SHIELD_PODZOL, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(15), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); // Tundra - public static final PlacedFeature TUNDRA_SPIRES = register("tundra_spires", AetherMiscConfiguredFeatures.TUNDRA_SPIRES.withPlacement(ChancePlacementModifier.of(14), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 10)))); + public static final RegistryEntry TUNDRA_SPIRES = register("tundra_spires", AetherMiscConfiguredFeatures.TUNDRA_SPIRES, ChancePlacementModifier.of(14), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 10))); - public static final PlacedFeature TUNDRA_PONDS = register("tundra_pond", AetherMiscConfiguredFeatures.TUNDRA_PONDS.withPlacement(CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)))); - public static final PlacedFeature TUNDRA_SNOW = register("tundra_snow", AetherMiscConfiguredFeatures.TUNDRA_SNOW.withPlacement(CountMultilayerPlacementModifier.of(2), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); + public static final RegistryEntry TUNDRA_PONDS = register("tundra_pond", AetherMiscConfiguredFeatures.TUNDRA_PONDS, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1))); + public static final RegistryEntry TUNDRA_SNOW = register("tundra_snow", AetherMiscConfiguredFeatures.TUNDRA_SNOW, CountMultilayerPlacementModifier.of(2), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); public static void init(){} } diff --git a/src/main/java/net/id/aether/world/feature/placed_features/AetherPlacedFeatures.java b/src/main/java/net/id/aether/world/feature/placed_features/AetherPlacedFeatures.java index 363ece96b..04cf54852 100644 --- a/src/main/java/net/id/aether/world/feature/placed_features/AetherPlacedFeatures.java +++ b/src/main/java/net/id/aether/world/feature/placed_features/AetherPlacedFeatures.java @@ -8,12 +8,17 @@ import net.minecraft.util.math.Vec3i; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.blockpredicate.BlockPredicate; -import net.minecraft.world.gen.decorator.BlockFilterPlacementModifier; -import net.minecraft.world.gen.decorator.HeightRangePlacementModifier; -import net.minecraft.world.gen.decorator.PlacementModifier; +import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.PlacedFeature; +import net.minecraft.world.gen.feature.PlacedFeatures; +import net.minecraft.world.gen.placementmodifier.BlockFilterPlacementModifier; +import net.minecraft.world.gen.placementmodifier.HeightRangePlacementModifier; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; + +import java.util.List; import static net.id.aether.Aether.locate; @@ -33,8 +38,8 @@ public class AetherPlacedFeatures { // for ease of familiarity with how 1.17 did it. static final PlacementModifier SPREAD_32_ABOVE = HeightRangePlacementModifier.uniform(YOffset.aboveBottom(32), YOffset.getTop()); - static PlacedFeature register(String id, PlacedFeature feature) { - return Registry.register(BuiltinRegistries.PLACED_FEATURE, locate(id), feature); + static RegistryEntry register(String id, RegistryEntry> feature, PlacementModifier... modifiers) { + return BuiltinRegistries.add(BuiltinRegistries.PLACED_FEATURE, locate(id), new PlacedFeature(RegistryEntry.upcast(feature), List.of(modifiers))); } public static void init() { diff --git a/src/main/java/net/id/aether/world/feature/placed_features/AetherTreePlacedFeatures.java b/src/main/java/net/id/aether/world/feature/placed_features/AetherTreePlacedFeatures.java index 52b5d661a..9771fb388 100644 --- a/src/main/java/net/id/aether/world/feature/placed_features/AetherTreePlacedFeatures.java +++ b/src/main/java/net/id/aether/world/feature/placed_features/AetherTreePlacedFeatures.java @@ -5,13 +5,13 @@ import net.id.aether.world.feature.placement_modifiers.CrystalTreeIslandPlacementModifier; import net.minecraft.block.Block; import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.blockpredicate.BlockPredicate; -import net.minecraft.world.gen.decorator.BlockFilterPlacementModifier; -import net.minecraft.world.gen.decorator.CountMultilayerPlacementModifier; -import net.minecraft.world.gen.decorator.CountPlacementModifier; -import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.PlacedFeature; -import net.minecraft.world.gen.feature.PlacedFeatures; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.BlockFilterPlacementModifier; +import net.minecraft.world.gen.placementmodifier.CountMultilayerPlacementModifier; +import net.minecraft.world.gen.placementmodifier.CountPlacementModifier; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; import java.util.List; @@ -24,51 +24,51 @@ public class AetherTreePlacedFeatures extends AetherPlacedFeatures{ Highlands */ // Default - public static final PlacedFeature SKYROOT_TREE = register("skyroot_tree", placed(AetherTreeConfiguredFeatures.SKYROOT_TREE, SKYROOT_SAPLING)); - public static final PlacedFeature GOLDEN_OAK_TREE = register("golden_oak_tree", placed(AetherTreeConfiguredFeatures.GOLDEN_OAK_TREE, GOLDEN_OAK_SAPLING)); - public static final PlacedFeature CRYSTAL_TREE = register("crystal_tree", placed(AetherTreeConfiguredFeatures.CRYSTAL_TREE, CRYSTAL_SAPLING)); - public static final PlacedFeature ORANGE_TREE = register("orange_tree", placed(AetherTreeConfiguredFeatures.ORANGE_TREE, ORANGE_SAPLING)); + public static final RegistryEntry SKYROOT_TREE = register("skyroot_tree", AetherTreeConfiguredFeatures.SKYROOT_TREE, placed(SKYROOT_SAPLING)); + public static final RegistryEntry GOLDEN_OAK_TREE = register("golden_oak_tree", AetherTreeConfiguredFeatures.GOLDEN_OAK_TREE, placed(GOLDEN_OAK_SAPLING)); + public static final RegistryEntry CRYSTAL_TREE = register("crystal_tree", AetherTreeConfiguredFeatures.CRYSTAL_TREE, placed(CRYSTAL_SAPLING)); + public static final RegistryEntry ORANGE_TREE = register("orange_tree", AetherTreeConfiguredFeatures.ORANGE_TREE, placed(ORANGE_SAPLING)); // Wisteria - public static final PlacedFeature ROSE_WISTERIA_TREE = register("rose_wisteria_tree", placed(AetherTreeConfiguredFeatures.ROSE_WISTERIA_TREE, ROSE_WISTERIA_SAPLING)); - public static final PlacedFeature LAVENDER_WISTERIA_TREE = register("lavender_wisteria_tree", placed(AetherTreeConfiguredFeatures.LAVENDER_WISTERIA_TREE, LAVENDER_WISTERIA_SAPLING)); - public static final PlacedFeature FROST_WISTERIA_TREE = register("frost_wisteria_tree", placed(AetherTreeConfiguredFeatures.FROST_WISTERIA_TREE, FROST_WISTERIA_SAPLING)); - public static final PlacedFeature BOREAL_WISTERIA_TREE = register("boreal_wisteria_tree", placed(AetherTreeConfiguredFeatures.BOREAL_WISTERIA_TREE, BOREAL_WISTERIA_SAPLING)); + public static final RegistryEntry ROSE_WISTERIA_TREE = register("rose_wisteria_tree", AetherTreeConfiguredFeatures.ROSE_WISTERIA_TREE, placed(ROSE_WISTERIA_SAPLING)); + public static final RegistryEntry LAVENDER_WISTERIA_TREE = register("lavender_wisteria_tree", AetherTreeConfiguredFeatures.LAVENDER_WISTERIA_TREE, placed(LAVENDER_WISTERIA_SAPLING)); + public static final RegistryEntry FROST_WISTERIA_TREE = register("frost_wisteria_tree", AetherTreeConfiguredFeatures.FROST_WISTERIA_TREE, placed(FROST_WISTERIA_SAPLING)); + public static final RegistryEntry BOREAL_WISTERIA_TREE = register("boreal_wisteria_tree", AetherTreeConfiguredFeatures.BOREAL_WISTERIA_TREE, placed(BOREAL_WISTERIA_SAPLING)); // Fancy - public static final PlacedFeature FANCY_ROSE_WISTERIA_TREE = register("fancy_rose_wisteria_tree", placed(AetherTreeConfiguredFeatures.FANCY_ROSE_WISTERIA_TREE, ROSE_WISTERIA_SAPLING)); - public static final PlacedFeature FANCY_LAVENDER_WISTERIA_TREE = register("fancy_lavender_wisteria_tree", placed(AetherTreeConfiguredFeatures.FANCY_LAVENDER_WISTERIA_TREE, LAVENDER_WISTERIA_SAPLING)); - public static final PlacedFeature FANCY_FROST_WISTERIA_TREE = register("fancy_frost_wisteria_tree", placed(AetherTreeConfiguredFeatures.FANCY_FROST_WISTERIA_TREE, FROST_WISTERIA_SAPLING)); - public static final PlacedFeature FANCY_BOREAL_WISTERIA_TREE = register("fancy_boreal_wisteria_tree", placed(AetherTreeConfiguredFeatures.FANCY_BOREAL_WISTERIA_TREE, BOREAL_WISTERIA_SAPLING)); - public static final PlacedFeature FANCY_SKYROOT_TREE = register("fancy_skyroot_tree", placed(AetherTreeConfiguredFeatures.FANCY_SKYROOT_TREE, SKYROOT_SAPLING)); + public static final RegistryEntry FANCY_ROSE_WISTERIA_TREE = register("fancy_rose_wisteria_tree", AetherTreeConfiguredFeatures.FANCY_ROSE_WISTERIA_TREE, placed(ROSE_WISTERIA_SAPLING)); + public static final RegistryEntry FANCY_LAVENDER_WISTERIA_TREE = register("fancy_lavender_wisteria_tree", AetherTreeConfiguredFeatures.FANCY_LAVENDER_WISTERIA_TREE, placed(LAVENDER_WISTERIA_SAPLING)); + public static final RegistryEntry FANCY_FROST_WISTERIA_TREE = register("fancy_frost_wisteria_tree", AetherTreeConfiguredFeatures.FANCY_FROST_WISTERIA_TREE, placed(FROST_WISTERIA_SAPLING)); + public static final RegistryEntry FANCY_BOREAL_WISTERIA_TREE = register("fancy_boreal_wisteria_tree", AetherTreeConfiguredFeatures.FANCY_BOREAL_WISTERIA_TREE, placed(BOREAL_WISTERIA_SAPLING)); + public static final RegistryEntry FANCY_SKYROOT_TREE = register("fancy_skyroot_tree", AetherTreeConfiguredFeatures.FANCY_SKYROOT_TREE, placed(SKYROOT_SAPLING)); // Tree Assortments - public static final PlacedFeature SCATTERED_TREES = register("scattered_trees", AetherTreeConfiguredFeatures.SCATTERED_TREES.withPlacement(CountMultilayerPlacementModifier.of(6), CountPlacementModifier.of(UniformIntProvider.create(0, 6)))); - public static final PlacedFeature SHIELD_TREES = register("shield_trees", AetherTreeConfiguredFeatures.SHIELD_TREES.withPlacement(CountMultilayerPlacementModifier.of(5), CountPlacementModifier.of(UniformIntProvider.create(0, 6)))); - public static final PlacedFeature DENSE_SHIELD_TREES = register("dense_shield_trees", AetherTreeConfiguredFeatures.DENSE_SHIELD_TREES.withPlacement(CountMultilayerPlacementModifier.of(12), ChancePlacementModifier.of(18))); - public static final PlacedFeature PLATEAU_TREES = register("plateau_trees", AetherTreeConfiguredFeatures.PLATEAU_TREES.withPlacement(ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)))); - public static final PlacedFeature MIXED_TREES = register("mixed_trees", AetherTreeConfiguredFeatures.MIXED_TREES.withPlacement(CountMultilayerPlacementModifier.of(1), ChancePlacementModifier.of(30))); - public static final PlacedFeature SPARSE_TREES = register("sparse_trees", AetherTreeConfiguredFeatures.SPARSE_TREES.withPlacement(CountMultilayerPlacementModifier.of(7), ChancePlacementModifier.of(100), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); - public static final PlacedFeature THICKET_TREES = register("thicket_trees", AetherTreeConfiguredFeatures.THICKET_TREES.withPlacement(CountMultilayerPlacementModifier.of(14), CountPlacementModifier.of(UniformIntProvider.create(0, 6)))); - public static final PlacedFeature RAINBOW_FOREST_TREES = register("wisteria_woods_trees", AetherTreeConfiguredFeatures.RAINBOW_FOREST_TREES.withPlacement(CountMultilayerPlacementModifier.of(17), CountPlacementModifier.of(UniformIntProvider.create(0, 4)))); + public static final RegistryEntry SCATTERED_TREES = register("scattered_trees", AetherTreeConfiguredFeatures.SCATTERED_TREES, CountMultilayerPlacementModifier.of(6), CountPlacementModifier.of(UniformIntProvider.create(0, 6))); + public static final RegistryEntry SHIELD_TREES = register("shield_trees", AetherTreeConfiguredFeatures.SHIELD_TREES, CountMultilayerPlacementModifier.of(5), CountPlacementModifier.of(UniformIntProvider.create(0, 6))); + public static final RegistryEntry DENSE_SHIELD_TREES = register("dense_shield_trees", AetherTreeConfiguredFeatures.DENSE_SHIELD_TREES, CountMultilayerPlacementModifier.of(12), ChancePlacementModifier.of(18)); + public static final RegistryEntry PLATEAU_TREES = register("plateau_trees", AetherTreeConfiguredFeatures.PLATEAU_TREES, ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1))); + public static final RegistryEntry MIXED_TREES = register("mixed_trees", AetherTreeConfiguredFeatures.MIXED_TREES, CountMultilayerPlacementModifier.of(1), ChancePlacementModifier.of(30)); + public static final RegistryEntry SPARSE_TREES = register("sparse_trees", AetherTreeConfiguredFeatures.SPARSE_TREES, CountMultilayerPlacementModifier.of(7), ChancePlacementModifier.of(100), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); + public static final RegistryEntry THICKET_TREES = register("thicket_trees", AetherTreeConfiguredFeatures.THICKET_TREES, CountMultilayerPlacementModifier.of(14), CountPlacementModifier.of(UniformIntProvider.create(0, 6))); + public static final RegistryEntry RAINBOW_FOREST_TREES = register("wisteria_woods_trees", AetherTreeConfiguredFeatures.RAINBOW_FOREST_TREES, CountMultilayerPlacementModifier.of(17), CountPlacementModifier.of(UniformIntProvider.create(0, 4))); // Fallen leaves - public static final PlacedFeature FALLEN_LEAVES = register("fallen_leaves", AetherTreeConfiguredFeatures.FALLEN_LEAVES.withPlacement(SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD)))); - public static final PlacedFeature ALT_FALLEN_LEAVES = register("alt_fallen_leaves", AetherTreeConfiguredFeatures.ALT_FALLEN_LEAVES.withPlacement(SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD)))); + public static final RegistryEntry FALLEN_LEAVES = register("fallen_leaves", AetherTreeConfiguredFeatures.FALLEN_LEAVES, SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD))); + public static final RegistryEntry ALT_FALLEN_LEAVES = register("alt_fallen_leaves", AetherTreeConfiguredFeatures.ALT_FALLEN_LEAVES, SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD))); - public static final PlacedFeature FALLEN_ROSE_LEAVES = register("fallen_rose_leaves", AetherTreeConfiguredFeatures.FALLEN_ROSE_LEAVES.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3)))); - public static final PlacedFeature FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", AetherTreeConfiguredFeatures.FALLEN_LAVENDER_LEAVES.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3)))); + public static final RegistryEntry FALLEN_ROSE_LEAVES = register("fallen_rose_leaves", AetherTreeConfiguredFeatures.FALLEN_ROSE_LEAVES, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3))); + public static final RegistryEntry FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", AetherTreeConfiguredFeatures.FALLEN_LAVENDER_LEAVES, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3))); // Logs & Stumps - public static final PlacedFeature THICKET_FALLEN_LOG = register("thicket_fallen_log", AetherTreeConfiguredFeatures.THICKET_FALLEN_LOG.withPlacement(ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(2), CountPlacementModifier.of(UniformIntProvider.create(0, 2)))); + public static final RegistryEntry THICKET_FALLEN_LOG = register("thicket_fallen_log", AetherTreeConfiguredFeatures.THICKET_FALLEN_LOG, ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(2), CountPlacementModifier.of(UniformIntProvider.create(0, 2))); - public static final PlacedFeature MOTTLED_FALLEN_LOG = register("mottled_fallen_log", AetherTreeConfiguredFeatures.MOTTLED_FALLEN_LOG.withPlacement(ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1))); - public static final PlacedFeature MOTTLED_HOLLOW_FALLEN_LOG = register("mottled_hollow_fallen_log", AetherTreeConfiguredFeatures.MOTTLED_HOLLOW_FALLEN_LOG.withPlacement(ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1))); + public static final RegistryEntry MOTTLED_FALLEN_LOG = register("mottled_fallen_log", AetherTreeConfiguredFeatures.MOTTLED_FALLEN_LOG, ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1)); + public static final RegistryEntry MOTTLED_HOLLOW_FALLEN_LOG = register("mottled_hollow_fallen_log", AetherTreeConfiguredFeatures.MOTTLED_HOLLOW_FALLEN_LOG, ChancePlacementModifier.of(3), CountMultilayerPlacementModifier.of(1)); - public static final PlacedFeature SHIELD_STUMPS = register("shield_stumps", AetherTreeConfiguredFeatures.SHIELD_STUMPS.withPlacement(CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)))); - public static final PlacedFeature SHIELD_HOLLOW_STUMPS = register("shield_hollow_stumps", AetherTreeConfiguredFeatures.SHIELD_HOLLOW_STUMPS.withPlacement(CountMultilayerPlacementModifier.of(1))); + public static final RegistryEntry SHIELD_STUMPS = register("shield_stumps", AetherTreeConfiguredFeatures.SHIELD_STUMPS, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1))); + public static final RegistryEntry SHIELD_HOLLOW_STUMPS = register("shield_hollow_stumps", AetherTreeConfiguredFeatures.SHIELD_HOLLOW_STUMPS, CountMultilayerPlacementModifier.of(1)); - public static final PlacedFeature SHIELD_FALLEN_LEAVES = register("shield_fallen_leaves", AetherTreeConfiguredFeatures.SHIELD_FALLEN_LEAVES.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(4), CountPlacementModifier.of(UniformIntProvider.create(0, 3)), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD)))); + public static final RegistryEntry SHIELD_FALLEN_LEAVES = register("shield_fallen_leaves", AetherTreeConfiguredFeatures.SHIELD_FALLEN_LEAVES, PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(4), CountPlacementModifier.of(UniformIntProvider.create(0, 3)), BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(AETHER_GROUD))); // Crystal Tree Island - public static final PlacedFeature CRYSTAL_TREE_ISLAND = register("crystal_tree_island", AetherTreeConfiguredFeatures.CRYSTAL_TREE_ISLAND.withPlacement(CrystalTreeIslandPlacementModifier.of())); + public static final RegistryEntry CRYSTAL_TREE_ISLAND = register("crystal_tree_island", AetherTreeConfiguredFeatures.CRYSTAL_TREE_ISLAND, CrystalTreeIslandPlacementModifier.of()); - private static PlacedFeature placed(ConfiguredFeature cfg, Block sapling){ - return cfg.withWouldSurviveFilter(sapling); + private static PlacementModifier placed(Block sapling){ + return PlacedFeatures.wouldSurvive(sapling); } public static void init(){} diff --git a/src/main/java/net/id/aether/world/feature/placed_features/AetherVegetationPlacedFeatures.java b/src/main/java/net/id/aether/world/feature/placed_features/AetherVegetationPlacedFeatures.java index d1e5e9c75..ac10e19e5 100644 --- a/src/main/java/net/id/aether/world/feature/placed_features/AetherVegetationPlacedFeatures.java +++ b/src/main/java/net/id/aether/world/feature/placed_features/AetherVegetationPlacedFeatures.java @@ -3,11 +3,11 @@ import net.id.aether.world.feature.configured_features.AetherVegetationConfiguredFeatures; import net.id.aether.world.feature.placement_modifiers.ChancePlacementModifier; import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.YOffset; -import net.minecraft.world.gen.decorator.*; -import net.minecraft.world.gen.feature.PlacedFeature; -import net.minecraft.world.gen.feature.PlacedFeatures; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.*; import static net.minecraft.world.gen.feature.VegetationPlacedFeatures.NOT_IN_SURFACE_WATER_MODIFIER; @@ -16,34 +16,34 @@ public class AetherVegetationPlacedFeatures extends AetherPlacedFeatures{ Highlands */ // Default - public static final PlacedFeature AETHER_BUSH = register("aether_bush", AetherVegetationConfiguredFeatures.AETHER_BUSH.withPlacement(SPREAD_32_ABOVE, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(4))); - public static final PlacedFeature AETHER_DENSE_BUSH = register("aether_dense_bush", AetherVegetationConfiguredFeatures.AETHER_DENSE_BUSH.withPlacement(CountMultilayerPlacementModifier.of(3), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); - public static final PlacedFeature AETHER_FLOWERS = register("aether_flowers", AetherVegetationConfiguredFeatures.AETHER_FLOWERS.withPlacement(CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(32), SquarePlacementModifier.of(), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); - public static final PlacedFeature AETHER_GRASS = register("aether_grass", AetherVegetationConfiguredFeatures.AETHER_GRASS_BUSH.withPlacement(CountPlacementModifier.of(10), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); - public static final PlacedFeature AETHER_GRASS_BONEMEAL = register("aether_grass_bonemeal", AetherVegetationConfiguredFeatures.AETHER_GRASS_BONEMEAL.withInAirFilter()); - public static final PlacedFeature AETHER_TALL_GRASS = register("aether_tall_grass", AetherVegetationConfiguredFeatures.AETHER_TALL_GRASS_BUSH.withPlacement(CountPlacementModifier.of(3), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); + public static final RegistryEntry AETHER_BUSH = register("aether_bush", AetherVegetationConfiguredFeatures.AETHER_BUSH, SPREAD_32_ABOVE, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(4)); + public static final RegistryEntry AETHER_DENSE_BUSH = register("aether_dense_bush", AetherVegetationConfiguredFeatures.AETHER_DENSE_BUSH, CountMultilayerPlacementModifier.of(3), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); + public static final RegistryEntry AETHER_FLOWERS = register("aether_flowers", AetherVegetationConfiguredFeatures.AETHER_FLOWERS, CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(32), SquarePlacementModifier.of(), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); + public static final RegistryEntry AETHER_GRASS = register("aether_grass", AetherVegetationConfiguredFeatures.AETHER_GRASS_BUSH, CountPlacementModifier.of(10), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); + public static final RegistryEntry AETHER_GRASS_BONEMEAL = register("aether_grass_bonemeal", AetherVegetationConfiguredFeatures.AETHER_GRASS_BONEMEAL, PlacedFeatures.isAir()); + public static final RegistryEntry AETHER_TALL_GRASS = register("aether_tall_grass", AetherVegetationConfiguredFeatures.AETHER_TALL_GRASS_BUSH, CountPlacementModifier.of(3), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); - public static final PlacedFeature FLUTEGRASS = register("flutegrass", AetherVegetationConfiguredFeatures.FLUTEGRASS.withPlacement(CountPlacementModifier.of(30), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); - public static final PlacedFeature FLUTEGRASS_BONEMEAL = register("flutegrass_bonemeal", AetherVegetationConfiguredFeatures.FLUTEGRASS_BONEMEAL.withInAirFilter()); + public static final RegistryEntry FLUTEGRASS = register("flutegrass", AetherVegetationConfiguredFeatures.FLUTEGRASS, CountPlacementModifier.of(30), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); + public static final RegistryEntry FLUTEGRASS_BONEMEAL = register("flutegrass_bonemeal", AetherVegetationConfiguredFeatures.FLUTEGRASS_BONEMEAL, PlacedFeatures.isAir()); - public static final PlacedFeature PATCH_BLUEBERRY = register("patch_blueberry", AetherVegetationConfiguredFeatures.PATCH_BLUEBERRY.withPlacement(NOT_IN_SURFACE_WATER_MODIFIER, CountPlacementModifier.of(10), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), BiomePlacementModifier.of())); + public static final RegistryEntry PATCH_BLUEBERRY = register("patch_blueberry", AetherVegetationConfiguredFeatures.PATCH_BLUEBERRY, NOT_IN_SURFACE_WATER_MODIFIER, CountPlacementModifier.of(10), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), BiomePlacementModifier.of()); // Plato - public static final PlacedFeature PLATEAU_FOLIAGE = register("plateau_foliage", AetherVegetationConfiguredFeatures.PLATEAU_FOLIAGE.withPlacement(CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 4)))); - public static final PlacedFeature PLATEAU_FLOWERING_GRASS = register("plateau_flowering_grass", AetherVegetationConfiguredFeatures.PLATEAU_FLOWERING_GRASS.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 5)), ON_SOLID_GROUND)); - public static final PlacedFeature PLATEAU_SHAMROCK = register("plateau_shamrock", AetherVegetationConfiguredFeatures.PLATEAU_SHAMROCK.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(6), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND)); + public static final RegistryEntry PLATEAU_FOLIAGE = register("plateau_foliage", AetherVegetationConfiguredFeatures.PLATEAU_FOLIAGE, CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 4))); + public static final RegistryEntry PLATEAU_FLOWERING_GRASS = register("plateau_flowering_grass", AetherVegetationConfiguredFeatures.PLATEAU_FLOWERING_GRASS, PlacedFeatures.BOTTOM_TO_TOP_RANGE, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 5)), ON_SOLID_GROUND); + public static final RegistryEntry PLATEAU_SHAMROCK = register("plateau_shamrock", AetherVegetationConfiguredFeatures.PLATEAU_SHAMROCK, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(6), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND); // Shield - public static final PlacedFeature SHIELD_FLAX = register("shield_flax", AetherVegetationConfiguredFeatures.SHIELD_FLAX.withPlacement(SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), ChancePlacementModifier.of(3), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of())); - public static final PlacedFeature SHIELD_NETTLES = register("shield_nettles", AetherVegetationConfiguredFeatures.SHIELD_NETTLES.withPlacement(CountMultilayerPlacementModifier.of(30), CountPlacementModifier.of(UniformIntProvider.create(0, 12)), ON_SOLID_GROUND)); - public static final PlacedFeature SHIELD_FOLIAGE = register("shield_foliage", AetherVegetationConfiguredFeatures.SHIELD_FOLIAGE.withPlacement(CountMultilayerPlacementModifier.of(5), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND)); + public static final RegistryEntry SHIELD_FLAX = register("shield_flax", AetherVegetationConfiguredFeatures.SHIELD_FLAX, SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), ChancePlacementModifier.of(3), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); + public static final RegistryEntry SHIELD_NETTLES = register("shield_nettles", AetherVegetationConfiguredFeatures.SHIELD_NETTLES, CountMultilayerPlacementModifier.of(30), CountPlacementModifier.of(UniformIntProvider.create(0, 12)), ON_SOLID_GROUND); + public static final RegistryEntry SHIELD_FOLIAGE = register("shield_foliage", AetherVegetationConfiguredFeatures.SHIELD_FOLIAGE, CountMultilayerPlacementModifier.of(5), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND); // Tundra - public static final PlacedFeature TUNDRA_FOLIAGE = register("tundra_foliage", AetherVegetationConfiguredFeatures.TUNDRA_FOLIAGE.withPlacement(CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 3)))); + public static final RegistryEntry TUNDRA_FOLIAGE = register("tundra_foliage", AetherVegetationConfiguredFeatures.TUNDRA_FOLIAGE, CountMultilayerPlacementModifier.of(3), CountPlacementModifier.of(UniformIntProvider.create(0, 3))); // Forest - public static final PlacedFeature THICKET_LIVERWORT = register("thicket_liverwort", AetherVegetationConfiguredFeatures.THICKET_LIVERWORT.withPlacement(CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND)); - public static final PlacedFeature THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", AetherVegetationConfiguredFeatures.THICKET_LIVERWORT_CARPET.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(6), CountMultilayerPlacementModifier.of(1), ON_SOLID_GROUND)); - public static final PlacedFeature THICKET_SHAMROCK = register("thicket_shamrock", AetherVegetationConfiguredFeatures.THICKET_SHAMROCK.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(8), CountMultilayerPlacementModifier.of(1), ON_SOLID_GROUND)); + public static final RegistryEntry THICKET_LIVERWORT = register("thicket_liverwort", AetherVegetationConfiguredFeatures.THICKET_LIVERWORT, CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 2)), ON_SOLID_GROUND); + public static final RegistryEntry THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", AetherVegetationConfiguredFeatures.THICKET_LIVERWORT_CARPET, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(6), CountMultilayerPlacementModifier.of(1), ON_SOLID_GROUND); + public static final RegistryEntry THICKET_SHAMROCK = register("thicket_shamrock", AetherVegetationConfiguredFeatures.THICKET_SHAMROCK, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(8), CountMultilayerPlacementModifier.of(1), ON_SOLID_GROUND); // ? - public static final PlacedFeature RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", AetherVegetationConfiguredFeatures.RAINBOW_MALT_SPRIGS.withPlacement(PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)), ON_SOLID_GROUND)); + public static final RegistryEntry RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", AetherVegetationConfiguredFeatures.RAINBOW_MALT_SPRIGS, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 1)), ON_SOLID_GROUND); public static void init(){} } diff --git a/src/main/java/net/id/aether/world/feature/placement_modifiers/AetherPlacementModifiers.java b/src/main/java/net/id/aether/world/feature/placement_modifiers/AetherPlacementModifiers.java index 457d5ab70..608273d6a 100644 --- a/src/main/java/net/id/aether/world/feature/placement_modifiers/AetherPlacementModifiers.java +++ b/src/main/java/net/id/aether/world/feature/placement_modifiers/AetherPlacementModifiers.java @@ -2,8 +2,8 @@ import com.mojang.serialization.Codec; import net.minecraft.util.registry.Registry; -import net.minecraft.world.gen.decorator.PlacementModifier; -import net.minecraft.world.gen.decorator.PlacementModifierType; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; +import net.minecraft.world.gen.placementmodifier.PlacementModifierType; import static net.id.aether.Aether.locate; diff --git a/src/main/java/net/id/aether/world/feature/placement_modifiers/ChancePlacementModifier.java b/src/main/java/net/id/aether/world/feature/placement_modifiers/ChancePlacementModifier.java index c40f4897d..3174cf08a 100644 --- a/src/main/java/net/id/aether/world/feature/placement_modifiers/ChancePlacementModifier.java +++ b/src/main/java/net/id/aether/world/feature/placement_modifiers/ChancePlacementModifier.java @@ -4,8 +4,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.IntProvider; -import net.minecraft.world.gen.decorator.AbstractCountPlacementModifier; -import net.minecraft.world.gen.decorator.PlacementModifierType; +import net.minecraft.world.gen.placementmodifier.AbstractCountPlacementModifier; +import net.minecraft.world.gen.placementmodifier.PlacementModifierType; import java.util.Random; diff --git a/src/main/java/net/id/aether/world/feature/placement_modifiers/CrystalTreeIslandPlacementModifier.java b/src/main/java/net/id/aether/world/feature/placement_modifiers/CrystalTreeIslandPlacementModifier.java index f218c8ed6..9c91dd1b0 100644 --- a/src/main/java/net/id/aether/world/feature/placement_modifiers/CrystalTreeIslandPlacementModifier.java +++ b/src/main/java/net/id/aether/world/feature/placement_modifiers/CrystalTreeIslandPlacementModifier.java @@ -2,9 +2,9 @@ import com.mojang.serialization.Codec; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.gen.decorator.DecoratorContext; -import net.minecraft.world.gen.decorator.PlacementModifier; -import net.minecraft.world.gen.decorator.PlacementModifierType; +import net.minecraft.world.gen.feature.FeaturePlacementContext; +import net.minecraft.world.gen.placementmodifier.PlacementModifier; +import net.minecraft.world.gen.placementmodifier.PlacementModifierType; import java.util.Random; import java.util.stream.Stream; @@ -19,7 +19,7 @@ public static CrystalTreeIslandPlacementModifier of() { } @Override - public Stream getPositions(DecoratorContext context, Random random, BlockPos blockPos) { + public Stream getPositions(FeaturePlacementContext context, Random random, BlockPos blockPos) { Stream stream = Stream.empty(); if (random.nextInt(300) == 0) { return Stream.concat(stream, Stream.of(blockPos.add(random.nextInt(16), 107 + random.nextInt(15) - context.getBottomY(), random.nextInt(16)))); diff --git a/src/main/java/net/id/aether/world/feature/structure/AetherStructureFeatures.java b/src/main/java/net/id/aether/world/feature/structure/AetherStructureFeatures.java index 91aa7bc99..a66dce9e8 100644 --- a/src/main/java/net/id/aether/world/feature/structure/AetherStructureFeatures.java +++ b/src/main/java/net/id/aether/world/feature/structure/AetherStructureFeatures.java @@ -1,7 +1,7 @@ package net.id.aether.world.feature.structure; -import net.fabricmc.fabric.mixin.structure.StructureFeatureAccessor; import net.id.aether.Aether; +import net.id.aether.mixin.structure.StructureFeatureAccessor; import net.id.aether.world.feature.structure.generator.OrangeRuinGenerator; import net.id.aether.world.feature.structure.generator.SkyrootTowerGenerator; import net.id.aether.world.feature.structure.generator.WellGenerator; diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/BorealWisteriaSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/BorealWisteriaSaplingGenerator.java index 8fe04855a..1095aa34f 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/BorealWisteriaSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/BorealWisteriaSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class BorealWisteriaSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.BOREAL_WISTERIA_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/CrystalSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/CrystalSaplingGenerator.java index 0a9496f78..c13f39f04 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/CrystalSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/CrystalSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class CrystalSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.CRYSTAL_TREE; } } diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/FrostWisteriaSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/FrostWisteriaSaplingGenerator.java index 991b2d01b..3715e6b8f 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/FrostWisteriaSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/FrostWisteriaSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class FrostWisteriaSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.FROST_WISTERIA_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/GoldenOakSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/GoldenOakSaplingGenerator.java index a0833043d..5c47bab53 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/GoldenOakSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/GoldenOakSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class GoldenOakSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.GOLDEN_OAK_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/LavenderWisteriaSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/LavenderWisteriaSaplingGenerator.java index 7a613e2ce..971162fcd 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/LavenderWisteriaSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/LavenderWisteriaSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class LavenderWisteriaSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.LAVENDER_WISTERIA_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/OrangeSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/OrangeSaplingGenerator.java index 387a21999..358f9390f 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/OrangeSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/OrangeSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class OrangeSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.ORANGE_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/RoseWisteriaSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/RoseWisteriaSaplingGenerator.java index 726462276..25e87d8b7 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/RoseWisteriaSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/RoseWisteriaSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class RoseWisteriaSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.ROSE_WISTERIA_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/feature/tree/generator/SkyrootSaplingGenerator.java b/src/main/java/net/id/aether/world/feature/tree/generator/SkyrootSaplingGenerator.java index 58f2729ad..4edea86db 100644 --- a/src/main/java/net/id/aether/world/feature/tree/generator/SkyrootSaplingGenerator.java +++ b/src/main/java/net/id/aether/world/feature/tree/generator/SkyrootSaplingGenerator.java @@ -2,6 +2,7 @@ import net.id.aether.world.feature.configured_features.AetherTreeConfiguredFeatures; import net.minecraft.block.sapling.SaplingGenerator; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.TreeFeatureConfig; import org.jetbrains.annotations.Nullable; @@ -10,7 +11,7 @@ public class SkyrootSaplingGenerator extends SaplingGenerator { @Override - protected @Nullable ConfiguredFeature getTreeFeature(Random random, boolean bl) { + protected @Nullable RegistryEntry> getTreeFeature(Random random, boolean bl) { return AetherTreeConfiguredFeatures.SKYROOT_TREE; } } \ No newline at end of file diff --git a/src/main/java/net/id/aether/world/gen/carver/AetherCarvers.java b/src/main/java/net/id/aether/world/gen/carver/AetherCarvers.java index 89b48b78b..d695f450e 100644 --- a/src/main/java/net/id/aether/world/gen/carver/AetherCarvers.java +++ b/src/main/java/net/id/aether/world/gen/carver/AetherCarvers.java @@ -8,6 +8,7 @@ import net.minecraft.util.math.intprovider.UniformIntProvider; import net.minecraft.util.registry.BuiltinRegistries; import net.minecraft.util.registry.Registry; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.carver.Carver; import net.minecraft.world.gen.carver.CarverConfig; @@ -20,24 +21,24 @@ public class AetherCarvers { public static final Carver AERCLOUD_CARVER = register("aercloud_carver", new CloudCarver(CloudCarverConfig.CODEC)); // public static final ConfiguredCarver GIANT_COLD_AERCLOUD_CARVER = register("cold_aercloud_giant", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.00105F, UniformHeightProvider.create(YOffset.aboveBottom(112), YOffset.fixed(240)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(1.0F, 1.75F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.0125F), UniformFloatProvider.create(0.35F, 0.65F), UniformIntProvider.create(12, 18), ConstantFloatProvider.create(1), ConstantIntProvider.create(10), ConstantFloatProvider.create(2.75F)))); - public static final ConfiguredCarver LARGE_COLD_AERCLOUD_CARVER = register("large_cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0003F, UniformHeightProvider.create(YOffset.fixed(260), YOffset.fixed(340)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(1.0F, 2.15F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.1F), UniformFloatProvider.create(0.285F, 0.45F), UniformIntProvider.create(8, 9), ConstantFloatProvider.create(0.3F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); - public static final ConfiguredCarver COLD_AERCLOUD_CARVER = register("cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0105F, UniformHeightProvider.create(YOffset.aboveBottom(4), YOffset.fixed(112)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.285F, 0.45F), UniformIntProvider.create(3, 4), ConstantFloatProvider.create(2), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.25F)))); - public static final ConfiguredCarver TINY_COLD_AERCLOUD_CARVER = register("tiny_cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.01F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); + public static final RegistryEntry> LARGE_COLD_AERCLOUD_CARVER = register("large_cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0003F, UniformHeightProvider.create(YOffset.fixed(260), YOffset.fixed(340)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(1.0F, 2.15F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.1F), UniformFloatProvider.create(0.285F, 0.45F), UniformIntProvider.create(8, 9), ConstantFloatProvider.create(0.3F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); + public static final RegistryEntry> COLD_AERCLOUD_CARVER = register("cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0105F, UniformHeightProvider.create(YOffset.aboveBottom(4), YOffset.fixed(112)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.285F, 0.45F), UniformIntProvider.create(3, 4), ConstantFloatProvider.create(2), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.25F)))); + public static final RegistryEntry> TINY_COLD_AERCLOUD_CARVER = register("tiny_cold_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.01F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.COLD_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); - public static final ConfiguredCarver LARGE_BLUE_AERCLOUD_CARVER = register("large_blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.001F, UniformHeightProvider.create(YOffset.fixed(230), YOffset.fixed(310)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(5.48F, 6.75F), UniformFloatProvider.create(0.3F, 0.5F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.233F), UniformFloatProvider.create(0.285F, 0.35F), UniformIntProvider.create(6, 7), ConstantFloatProvider.create(0.6F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); - public static final ConfiguredCarver BLUE_AERCLOUD_CARVER = register("blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.007F, UniformHeightProvider.create(YOffset.aboveBottom(4), YOffset.fixed(32)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.5F, 1.25F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.175F), UniformFloatProvider.create(0.15F, 0.3F), UniformIntProvider.create(3, 4), ConstantFloatProvider.create(2), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.25F)))); - public static final ConfiguredCarver TINY_BLUE_AERCLOUD_CARVER = register("tiny_blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.009F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); + public static final RegistryEntry> LARGE_BLUE_AERCLOUD_CARVER = register("large_blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.001F, UniformHeightProvider.create(YOffset.fixed(230), YOffset.fixed(310)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(5.48F, 6.75F), UniformFloatProvider.create(0.3F, 0.5F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.233F), UniformFloatProvider.create(0.285F, 0.35F), UniformIntProvider.create(6, 7), ConstantFloatProvider.create(0.6F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); + public static final RegistryEntry> BLUE_AERCLOUD_CARVER = register("blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.007F, UniformHeightProvider.create(YOffset.aboveBottom(4), YOffset.fixed(32)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.5F, 1.25F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.175F), UniformFloatProvider.create(0.15F, 0.3F), UniformIntProvider.create(3, 4), ConstantFloatProvider.create(2), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.25F)))); + public static final RegistryEntry> TINY_BLUE_AERCLOUD_CARVER = register("tiny_blue_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.009F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.BLUE_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); - public static final ConfiguredCarver LARGE_GOLDEN_AERCLOUD_CARVER = register("large_golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0006F, UniformHeightProvider.create(YOffset.fixed(290), YOffset.fixed(360)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(1.6F, 2.0F), UniformFloatProvider.create(1.5F, 1.85F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.322F), UniformFloatProvider.create(0.585F, 0.75F), UniformIntProvider.create(7, 9), ConstantFloatProvider.create(0.4F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); - public static final ConfiguredCarver GOLDEN_AERCLOUD_CARVER = register("golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0085F, UniformHeightProvider.create(YOffset.aboveBottom(14), YOffset.fixed(68)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(0.5F, 1.25F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.225F), UniformFloatProvider.create(0.35F, 0.5F), UniformIntProvider.create(2, 5), ConstantFloatProvider.create(1.5F), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.35F)))); - public static final ConfiguredCarver TINY_GOLDEN_AERCLOUD_CARVER = register("tiny_golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.00875F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); + public static final RegistryEntry> LARGE_GOLDEN_AERCLOUD_CARVER = register("large_golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0006F, UniformHeightProvider.create(YOffset.fixed(290), YOffset.fixed(360)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(1.6F, 2.0F), UniformFloatProvider.create(1.5F, 1.85F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.322F), UniformFloatProvider.create(0.585F, 0.75F), UniformIntProvider.create(7, 9), ConstantFloatProvider.create(0.4F), ConstantIntProvider.create(16), ConstantFloatProvider.create(1F)))); + public static final RegistryEntry> GOLDEN_AERCLOUD_CARVER = register("golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.0085F, UniformHeightProvider.create(YOffset.aboveBottom(14), YOffset.fixed(68)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(32), UniformFloatProvider.create(0.5F, 1.25F), UniformFloatProvider.create(0.6F, 1.0F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.225F), UniformFloatProvider.create(0.35F, 0.5F), UniformIntProvider.create(2, 5), ConstantFloatProvider.create(1.5F), ConstantIntProvider.create(3), ConstantFloatProvider.create(0.35F)))); + public static final RegistryEntry> TINY_GOLDEN_AERCLOUD_CARVER = register("tiny_golden_aercloud", AERCLOUD_CARVER.configure(new CloudCarverConfig(0.00875F, UniformHeightProvider.create(YOffset.aboveBottom(100), YOffset.fixed(260)), UniformFloatProvider.create(0.5F, 1.1F), YOffset.aboveBottom(0), UniformFloatProvider.create(0.3F, 0.75F), UniformFloatProvider.create(0.36F, 0.6F), AetherBlocks.GOLDEN_AERCLOUD.getDefaultState(), ConstantFloatProvider.create(0.15F), UniformFloatProvider.create(0.785F, 1.25F), UniformIntProvider.create(1, 2), ConstantFloatProvider.create(3), ConstantIntProvider.create(1), ConstantFloatProvider.create(0.065F)))); @SuppressWarnings("unchecked") public static Carver register(String name, Carver carver) { return (Carver) Registry.register(Registry.CARVER, Aether.locate(name), carver); } - public static ConfiguredCarver register(String name, ConfiguredCarver carver) { + public static RegistryEntry> register(String name, ConfiguredCarver carver) { return BuiltinRegistries.add(BuiltinRegistries.CONFIGURED_CARVER, Aether.locate(name), carver); } diff --git a/src/main/java/net/id/aether/world/gen/carver/CloudCarver.java b/src/main/java/net/id/aether/world/gen/carver/CloudCarver.java index 0a49de23a..143761c35 100644 --- a/src/main/java/net/id/aether/world/gen/carver/CloudCarver.java +++ b/src/main/java/net/id/aether/world/gen/carver/CloudCarver.java @@ -7,6 +7,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.registry.RegistryEntry; import net.minecraft.world.biome.Biome; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.gen.carver.Carver; @@ -30,7 +31,7 @@ private static boolean isPositionExcluded(double scaledRelativeX, double scaledR } @Override - public boolean carve(CarverContext context, CloudCarverConfig config, Chunk chunk, Function posToBiome, Random random, AquiferSampler sampler, ChunkPos pos, CarvingMask carvingMask) { + public boolean carve(CarverContext context, CloudCarverConfig config, Chunk chunk, Function> posToBiome, Random random, AquiferSampler sampler, ChunkPos pos, CarvingMask carvingMask) { int mainChunkX = chunk.getPos().x; int mainChunkZ = chunk.getPos().z; @@ -101,7 +102,7 @@ public boolean carve(CarverContext context, CloudCarverConfig config, Chunk chun // this.carveRegion(chunk, config, random, seaLevel, mainChunkX, mainChunkZ, x + 1.0, y, z, scaledYaw, scaledPitch); //} - protected void carveTunnels(CarverContext context, CloudCarverConfig config, Chunk chunk, Function posToBiome, CarvingMask carvingMask, long seed, AquiferSampler sampler, int mainChunkX, int mainChunkZ, double x, double y, double z, float width, float yaw, float pitch, float yawToPitchRatio, int branchStartIndex, int branchCount, SkipPredicate skipPredicate) { + protected void carveTunnels(CarverContext context, CloudCarverConfig config, Chunk chunk, Function> posToBiome, CarvingMask carvingMask, long seed, AquiferSampler sampler, int mainChunkX, int mainChunkZ, double x, double y, double z, float width, float yaw, float pitch, float yawToPitchRatio, int branchStartIndex, int branchCount, SkipPredicate skipPredicate) { // Get the position for starting the next branch, from 25% of the total length to 75% to ensure it doesn't branch near the ends Random random = new Random(seed); diff --git a/src/main/resources/data/the_aether/dimension_type/the_aether.json b/src/main/resources/data/the_aether/dimension_type/the_aether.json index 44725a55a..feb9e56e9 100644 --- a/src/main/resources/data/the_aether/dimension_type/the_aether.json +++ b/src/main/resources/data/the_aether/dimension_type/the_aether.json @@ -1,6 +1,6 @@ { "logical_height": 384, - "infiniburn": "minecraft:infiniburn_overworld", + "infiniburn": "#minecraft:infiniburn_overworld", "effects": "minecraft:overworld", "ambient_light": 0.06, "respawn_anchor_works": false, diff --git a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/orange_ruin.json b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/orange_ruin.json index 44e651b14..f583b38ff 100644 --- a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/orange_ruin.json +++ b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/orange_ruin.json @@ -1,4 +1,6 @@ { "config": {}, - "type": "the_aether:orange_ruin" + "type": "the_aether:orange_ruin", + "spawn_overrides": {}, + "biomes": [] } \ No newline at end of file diff --git a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/skyroot_tower.json b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/skyroot_tower.json index f173c9ad0..be15218b4 100644 --- a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/skyroot_tower.json +++ b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/skyroot_tower.json @@ -1,4 +1,6 @@ { "config": {}, - "type": "the_aether:skyroot_tower" + "type": "the_aether:skyroot_tower", + "spawn_overrides": {}, + "biomes": [] } \ No newline at end of file diff --git a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/well.json b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/well.json index f44bab8db..ba7ad3958 100644 --- a/src/main/resources/data/the_aether/worldgen/configured_structure_feature/well.json +++ b/src/main/resources/data/the_aether/worldgen/configured_structure_feature/well.json @@ -1,4 +1,6 @@ { "config": {}, - "type": "the_aether:well" + "type": "the_aether:well", + "spawn_overrides": {}, + "biomes": [] } \ No newline at end of file diff --git a/src/main/resources/data/the_aether/worldgen/noise_settings/aether_noise.json b/src/main/resources/data/the_aether/worldgen/noise_settings/aether_noise.json index 8ed094cfe..2aec5c443 100644 --- a/src/main/resources/data/the_aether/worldgen/noise_settings/aether_noise.json +++ b/src/main/resources/data/the_aether/worldgen/noise_settings/aether_noise.json @@ -15,6 +15,242 @@ "level": "8" } }, + "noise_router": { + "final_density": { + "argument1": { + "argument": { + "argument1": 0.64, + "argument2": { + "argument": { + "argument": { + "argument": { + "max_exclusive": 1.5625, + "when_in_range": { + "argument1": "minecraft:overworld/sloped_cheese", + "argument2": { + "argument1": 5.0, + "argument2": "minecraft:overworld/caves/entrances", + "type": "minecraft:mul" + }, + "type": "minecraft:min" + }, + "when_out_of_range": { + "argument1": { + "argument1": { + "argument1": { + "argument1": { + "argument1": 4.0, + "argument2": { + "argument": { + "noise": "minecraft:cave_layer", + "xz_scale": 1.0, + "y_scale": 8.0, + "type": "minecraft:noise" + }, + "type": "minecraft:square" + }, + "type": "minecraft:mul" + }, + "argument2": { + "argument1": { + "input": { + "argument1": 0.27, + "argument2": { + "noise": "minecraft:cave_cheese", + "xz_scale": 1.0, + "y_scale": 0.6666666666666666, + "type": "minecraft:noise" + }, + "type": "minecraft:add" + }, + "min": -1.0, + "max": 1.0, + "type": "minecraft:clamp" + }, + "argument2": { + "input": { + "argument1": 1.5, + "argument2": { + "argument1": -0.64, + "argument2": "minecraft:overworld/sloped_cheese", + "type": "minecraft:mul" + }, + "type": "minecraft:add" + }, + "min": 0.0, + "max": 0.5, + "type": "minecraft:clamp" + }, + "type": "minecraft:add" + }, + "type": "minecraft:add" + }, + "argument2": "minecraft:overworld/caves/entrances", + "type": "minecraft:min" + }, + "argument2": { + "argument1": "minecraft:overworld/caves/spaghetti_2d", + "argument2": "minecraft:overworld/caves/spaghetti_roughness_function", + "type": "minecraft:add" + }, + "type": "minecraft:min" + }, + "argument2": { + "max_exclusive": 0.03, + "when_in_range": -1000000.0, + "when_out_of_range": "minecraft:overworld/caves/pillars", + "input": "minecraft:overworld/caves/pillars", + "min_inclusive": -1000000.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:max" + }, + "input": "minecraft:overworld/sloped_cheese", + "min_inclusive": -1000000.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:slide" + }, + "type": "minecraft:blend_density" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:mul" + }, + "type": "minecraft:squeeze" + }, + "argument2": "minecraft:overworld/caves/noodle", + "type": "minecraft:min" + }, + "vein_toggle": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_veininess", + "xz_scale": 1.5, + "y_scale": 1.5, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "vein_ridged": { + "argument1": -0.07999999821186066, + "argument2": { + "argument1": { + "argument": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_vein_a", + "xz_scale": 4.0, + "y_scale": 4.0, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:abs" + }, + "argument2": { + "argument": { + "argument": { + "max_exclusive": 51.0, + "when_in_range": { + "noise": "minecraft:ore_vein_b", + "xz_scale": 4.0, + "y_scale": 4.0, + "type": "minecraft:noise" + }, + "when_out_of_range": 0.0, + "input": "minecraft:y", + "min_inclusive": -60.0, + "type": "minecraft:range_choice" + }, + "type": "minecraft:interpolated" + }, + "type": "minecraft:abs" + }, + "type": "minecraft:max" + }, + "type": "minecraft:add" + }, + "vein_gap": { + "noise": "minecraft:ore_gap", + "xz_scale": 1.0, + "y_scale": 1.0, + "type": "minecraft:noise" + }, + "erosion": "minecraft:overworld/erosion", + "depth": "minecraft:overworld/depth", + "ridges": "minecraft:overworld/ridges", + "initial_density_without_jaggedness": { + "argument1": 4.0, + "argument2": { + "argument": { + "argument1": "minecraft:overworld/depth", + "argument2": { + "argument": "minecraft:overworld/factor", + "type": "minecraft:cache_2d" + }, + "type": "minecraft:mul" + }, + "type": "minecraft:quarter_negative" + }, + "type": "minecraft:mul" + }, + "lava": { + "noise": "minecraft:aquifer_lava", + "xz_scale": 1.0, + "y_scale": 1.0, + "type": "minecraft:noise" + }, + "temperature": { + "xz_scale": 0.25, + "y_scale": 0.0, + "noise": "minecraft:temperature", + "shift_x": "minecraft:shift_x", + "shift_y": 0.0, + "shift_z": "minecraft:shift_z", + "type": "minecraft:shifted_noise" + }, + "vegetation": { + "xz_scale": 0.25, + "y_scale": 0.0, + "noise": "minecraft:vegetation", + "shift_x": "minecraft:shift_x", + "shift_y": 0.0, + "shift_z": "minecraft:shift_z", + "type": "minecraft:shifted_noise" + }, + "continents": "minecraft:overworld/continents", + "barrier": { + "noise": "minecraft:aquifer_barrier", + "xz_scale": 1.0, + "y_scale": 0.5, + "type": "minecraft:noise" + }, + "fluid_level_floodedness": { + "noise": "minecraft:aquifer_fluid_level_floodedness", + "xz_scale": 1.0, + "y_scale": 0.67, + "type": "minecraft:noise" + }, + "fluid_level_spread": { + "noise": "minecraft:aquifer_fluid_level_spread", + "xz_scale": 1.0, + "y_scale": 0.7142857142857143, + "type": "minecraft:noise" + } + }, "noise": { "min_y": -16, "height": 192, @@ -53,7 +289,7 @@ "offset": 0, "surface_type": "floor", "add_surface_depth": false, - "add_surface_secondary_depth": false + "secondary_depth_range": 0 }, "then_run": { "type": "minecraft:sequence", @@ -103,7 +339,7 @@ "offset": 0, "surface_type": "floor", "add_surface_depth": false, - "add_surface_secondary_depth": false + "secondary_depth_range": 0 }, "then_run": { "type": "minecraft:sequence", @@ -145,7 +381,7 @@ "offset": 2, "surface_type": "floor", "add_surface_depth": false, - "add_surface_secondary_depth": false + "secondary_depth_range": 0 }, "then_run": { "type": "minecraft:sequence", @@ -189,7 +425,7 @@ "offset": 3, "surface_type": "floor", "add_surface_depth": false, - "add_surface_secondary_depth": false + "secondary_depth_range": 0 }, "then_run": { "type": "minecraft:sequence", @@ -243,7 +479,7 @@ "offset": 0, "surface_type": "floor", "add_surface_depth": false, - "add_surface_secondary_depth": false + "secondary_depth_range": 0 }, "then_run": { "type": "minecraft:sequence", diff --git a/src/main/resources/the_aether.mixins.json b/src/main/resources/the_aether.mixins.json index 8a722cdf2..612b39a4c 100644 --- a/src/main/resources/the_aether.mixins.json +++ b/src/main/resources/the_aether.mixins.json @@ -34,6 +34,7 @@ "server.ServerPlayerEntityMixin", "server.ServerPlayNetworkHandlerMixin", "server.ServerWorldMixin", + "structure.StructureFeatureAccessor", "util.NbtCompoundAccessor", "util.RarityMixin", "util.SignTypeAccessor"