diff --git a/src/main/java/net/id/paradiselost/ParadiseLost.java b/src/main/java/net/id/paradiselost/ParadiseLost.java index 60aa6a57b..fa34a1d1d 100644 --- a/src/main/java/net/id/paradiselost/ParadiseLost.java +++ b/src/main/java/net/id/paradiselost/ParadiseLost.java @@ -116,7 +116,6 @@ public void onInitializeClient() { ParadiseLostTextures.initClient(); ParadiseLostItemRenderers.initClient(); ParadiseLostScreens.initClient(); - ParadiseLostScreens.clientInit(); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/net/id/paradiselost/blocks/natural/ParadiseLostGrassBlock.java b/src/main/java/net/id/paradiselost/blocks/natural/ParadiseLostGrassBlock.java index 02b955573..dd5bfb8fb 100644 --- a/src/main/java/net/id/paradiselost/blocks/natural/ParadiseLostGrassBlock.java +++ b/src/main/java/net/id/paradiselost/blocks/natural/ParadiseLostGrassBlock.java @@ -65,7 +65,7 @@ public void grow(ServerWorld world, Random random, BlockPos pos, BlockState stat } placedFeature = ((RandomPatchFeatureConfig) list.get(0).config()).feature(); } else { - placedFeature = ParadiseLostVegetationPlacedFeatures.GRASS_BONEMEAL; + placedFeature = ParadiseLostVegetationPlacedFeatures.GRASS; } placedFeature.value().generateUnregistered(world, world.getChunkManager().getChunkGenerator(), random, blockPos2); } diff --git a/src/main/java/net/id/paradiselost/blocks/natural/tree/FruitingLeavesBlock.java b/src/main/java/net/id/paradiselost/blocks/natural/tree/FruitingLeavesBlock.java index b4c6f666a..a7521faa4 100644 --- a/src/main/java/net/id/paradiselost/blocks/natural/tree/FruitingLeavesBlock.java +++ b/src/main/java/net/id/paradiselost/blocks/natural/tree/FruitingLeavesBlock.java @@ -33,7 +33,7 @@ public class FruitingLeavesBlock extends ParadiseLostLeavesBlock { private final Supplier fruit; public FruitingLeavesBlock(Settings settings, Supplier fruit) { - super(settings, true); + super(settings); this.fruit = fruit; setDefaultState(getDefaultState().with(GROWTH, 0).with(CAPPED, false).with(NATURAL, false)); } diff --git a/src/main/java/net/id/paradiselost/world/feature/ParadiseLostFeatures.java b/src/main/java/net/id/paradiselost/world/feature/ParadiseLostFeatures.java index 67165bed2..35411a62d 100644 --- a/src/main/java/net/id/paradiselost/world/feature/ParadiseLostFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/ParadiseLostFeatures.java @@ -22,11 +22,10 @@ public class ParadiseLostFeatures { public static final GroundcoverFeature GROUNDCOVER_FEATURE = register("groundcover_feature", new GroundcoverFeature(GroundcoverFeatureConfig.CODEC)); public static final ParadiseLostBoulderFeature BOULDER = register("boulder", new ParadiseLostBoulderFeature(BoulderFeatureConfig.CODEC)); public static final VitrouliteSpireFeature VITROULITE_SPIRE_FEATURE = register("vitroulite_spire", new VitrouliteSpireFeature(DefaultFeatureConfig.CODEC)); - public static final FreezeParadiseLostTopLayerFeature FREEZE_TOP_LAYER_FEATURE_FEATURE = register("freeze_top_layer_feature", new FreezeParadiseLostTopLayerFeature(DefaultFeatureConfig.CODEC)); public static final ProjectedOrganicCoverFeature ORGANIC_GROUNDCOVER_FEATURE = register("organic_groundcover_feature", new ProjectedOrganicCoverFeature(ProjectedOrganicCoverConfig.CODEC)); - public static final HoneyNettleFeature HONEY_NETTLE_FEATURE = register("honey_nettle_feature", new HoneyNettleFeature(DefaultFeatureConfig.CODEC)); + public static final HoneyNettleFeature HONEY_NETTLE_FEATURE = register("honey_nettle", new HoneyNettleFeature(DefaultFeatureConfig.CODEC)); public static final PillarFeature PILLAR_FEATURE = register("pillar_feature", new PillarFeature(LongFeatureConfig.CODEC)); public static final FallenPillarFeature FALLEN_PILLAR_FEATURE = register("fallen_pillar_feature", new FallenPillarFeature(LongFeatureConfig.CODEC)); diff --git a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostConfiguredFeatures.java b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostConfiguredFeatures.java index 8f9fd1cd3..11f6f1b7a 100644 --- a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostConfiguredFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostConfiguredFeatures.java @@ -1,20 +1,10 @@ package net.id.paradiselost.world.feature.configured_features; -import net.id.paradiselost.world.feature.placed_features.ParadiseLostPlacedFeatures; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; -import net.minecraft.util.Identifier; import net.minecraft.world.gen.feature.*; -import net.minecraft.world.gen.placementmodifier.PlacementModifier; -import net.minecraft.world.gen.root.MangroveRootPlacer; -import net.minecraft.world.gen.stateprovider.BlockStateProvider; - -import java.util.List; import static net.id.paradiselost.ParadiseLost.locate; -import static net.id.paradiselost.blocks.ParadiseLostBlocks.*; /** * Folks extend this class to get the ooey-gooey goodness of shared Config stuff. @@ -26,55 +16,9 @@ public class ParadiseLostConfiguredFeatures { return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, locate(id)); } -// 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() { ParadiseLostTreeConfiguredFeatures.init(); ParadiseLostVegetationConfiguredFeatures.init(); ParadiseLostMiscConfiguredFeatures.init(); } - - public static class Configs { - static RandomPatchFeatureConfig blockPatch(int tries, int hSpread, int ySpread, BlockState state) { - return blockPatch(tries, hSpread, ySpread, BlockStateProvider.of(state)); - } - static RandomPatchFeatureConfig blockPatch(int tries, int hSpread, int ySpread, Block block) { - return blockPatch(tries, hSpread, ySpread, BlockStateProvider.of(block)); - } - static RandomPatchFeatureConfig blockPatch(int tries, int hSpread, int ySpread, BlockStateProvider provider) { - return new RandomPatchFeatureConfig( - tries, hSpread, ySpread, - singleBlock(provider, ParadiseLostPlacedFeatures.ON_SOLID_GROUND) - ); - } - 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 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); - } - - protected static > F register(String name, F feature) { - return Registry.register(Registry.FEATURE, locate(name), feature); - } - } } diff --git a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostMiscConfiguredFeatures.java b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostMiscConfiguredFeatures.java index 88462d9f7..793a0f38e 100644 --- a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostMiscConfiguredFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostMiscConfiguredFeatures.java @@ -1,33 +1,7 @@ package net.id.paradiselost.world.feature.configured_features; -import net.id.paradiselost.world.feature.ParadiseLostFeatures; -import net.id.paradiselost.world.feature.configs.BoulderFeatureConfig; -import net.id.paradiselost.world.feature.configs.GroundcoverFeatureConfig; -import net.id.paradiselost.world.feature.configs.JaggedOreConfig; -import net.id.paradiselost.world.feature.placed_features.ParadiseLostPlacedFeatures; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.SlabBlock; -import net.minecraft.block.enums.SlabType; -import net.minecraft.fluid.Fluids; import net.minecraft.registry.RegistryKey; -import net.minecraft.state.property.Properties; -import net.minecraft.structure.rule.BlockMatchRuleTest; -import net.minecraft.util.collection.DataPool; -import net.minecraft.util.math.intprovider.ConstantIntProvider; -import net.minecraft.util.math.intprovider.IntProvider; -import net.minecraft.util.math.intprovider.UniformIntProvider; -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; - -import java.util.List; - -import static net.id.paradiselost.blocks.ParadiseLostBlocks.*; public class ParadiseLostMiscConfiguredFeatures extends ParadiseLostConfiguredFeatures { /* diff --git a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostVegetationConfiguredFeatures.java b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostVegetationConfiguredFeatures.java index 9f8b5d95b..fef3cd03f 100644 --- a/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostVegetationConfiguredFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/configured_features/ParadiseLostVegetationConfiguredFeatures.java @@ -6,6 +6,7 @@ import net.id.paradiselost.world.feature.placed_features.ParadiseLostPlacedFeatures; import net.minecraft.block.BlockState; import net.minecraft.block.CropBlock; +import net.minecraft.registry.RegistryKey; import net.minecraft.state.property.Properties; import net.minecraft.util.collection.DataPool; import net.minecraft.util.math.Direction; @@ -24,90 +25,38 @@ import static net.id.paradiselost.blocks.ParadiseLostBlocks.*; public class ParadiseLostVegetationConfiguredFeatures extends ParadiseLostConfiguredFeatures { - /* - Highlands - */ - // Default - public static final RegistryEntry> BUSH = register("bush", Feature.RANDOM_PATCH, Configs.BUSH_CONFIG); - public static final RegistryEntry> DENSE_BUSH = register("dense_bush", Feature.RANDOM_PATCH, Configs.DENSE_BUSH_CONFIG); - public static final RegistryEntry> GRASS_BUSH = register("grass", Feature.RANDOM_PATCH, Configs.GRASS_BUSH_CONFIG); - public static final RegistryEntry> GRASS_BONEMEAL = register("grass_bonemeal", Feature.SIMPLE_BLOCK, Configs.singleBlockConfig(GRASS)); - public static final RegistryEntry> TALL_GRASS_BUSH = register("tall_grass", Feature.RANDOM_PATCH, Configs.TALL_GRASS_BUSH_CONFIG); - public static final RegistryEntry> FLOWERS = register("flowers", Feature.FLOWER, Configs.FLOWER_CONFIG); - public static final RegistryEntry> PATCH_BLACKCURRANT = register("patch_blackcurrant", Feature.RANDOM_PATCH, Configs.BLACKCURRANT_PATCH_CONFIG); - public static final RegistryEntry> PATCH_BROWN_SPORECAP = register("patch_brown_sporecap", Feature.RANDOM_PATCH, Configs.BROWN_SPORECAP_PATCH_CONFIG); - public static final RegistryEntry> PATCH_PINK_SPORECAP = register("patch_pink_sporecap", Feature.BLOCK_COLUMN, Configs.PINK_SPORECAP_PATCH_CONFIG); - public static final RegistryEntry> NATURAL_SWEDROOT = register("natural_swedroot", Feature.BLOCK_COLUMN, Configs.SWEDROOT_CONFIG); - // Plato - 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", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(GRASS_FLOWERING), UniformIntProvider.create(3, 10), ConstantIntProvider.create(5), UniformIntProvider.create(3, 6), 1.5)); - public static final RegistryEntry> PLATEAU_SHAMROCK = register("plateau_shamrock", ParadiseLostFeatures.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 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", ParadiseLostFeatures.HONEY_NETTLE_FEATURE, new DefaultFeatureConfig()); - // Thicket - public static final RegistryEntry> THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", ParadiseLostFeatures.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", ParadiseLostFeatures.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 RegistryEntry> TUNDRA_FOLIAGE = register("tundra_foliage", Feature.RANDOM_PATCH, Configs.TUNDRA_FOLIAGE_CONFIG); - // ? - public static final RegistryEntry> RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(3, 13), ConstantIntProvider.create(5), UniformIntProvider.create(3, 4), 1.4)); - - public static void init() { - } - private static class Configs extends ParadiseLostConfiguredFeatures.Configs { - /* - Highlands - */ - // Default - private static final RandomPatchFeatureConfig BUSH_CONFIG = blockPatch(128, 16, 7, ParadiseLostBlocks.BUSH); - private static final RandomPatchFeatureConfig DENSE_BUSH_CONFIG = blockPatch(16, 7, 3, ParadiseLostBlocks.BUSH); - private static final RandomPatchFeatureConfig GRASS_BUSH_CONFIG = blockPatch(32, 7, 3, GRASS); - private static final RandomPatchFeatureConfig TALL_GRASS_BUSH_CONFIG = blockPatch(32, 7, 3, TALL_GRASS); + // Patches + public static final RegistryKey> BUSH = of("patch_bush"); + public static final RegistryKey> DENSE_BUSH = of("patch_dense_bush"); + public static final RegistryKey> GRASS_BUSH = of("patch_grass"); + public static final RegistryKey> TALL_GRASS_BUSH = of("patch_tall_grass"); + public static final RegistryKey> FLOWERS = of("patch_flowers"); + public static final RegistryKey> PATCH_BLACKCURRANT = of("patch_blackcurrant"); + public static final RegistryKey> PATCH_BROWN_SPORECAP = of("patch_brown_sporecap"); + public static final RegistryKey> PATCH_PINK_SPORECAP = of("patch_pink_sporecap"); + public static final RegistryKey> NATURAL_SWEDROOT = of("natural_swedroot"); + + // Plateau + public static final RegistryKey> PLATEAU_FOLIAGE = of("patch_plateau_foliage"); + public static final RegistryKey> PLATEAU_FLOWERING_GRASS = of("patch_plateau_flowering_grass"); + public static final RegistryKey> PLATEAU_SHAMROCK = of("patch_plateau_shamrock"); + // public static final RegistryEntry> PLATEAU_FLOWERING_GRASS = register("patch_plateau_flowering_grass", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(GRASS_FLOWERING), UniformIntProvider.create(3, 10), ConstantIntProvider.create(5), UniformIntProvider.create(3, 6), 1.5)); + // public static final RegistryEntry> PLATEAU_SHAMROCK = register("patch_plateau_shamrock", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(MALT_SPRIG), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.4)); - private static final RandomPatchFeatureConfig FLOWER_CONFIG = blockPatch(64, 7, 3, new WeightedBlockStateProvider( - DataPool.builder() - .add(ATARAXIA.getDefaultState(), 20) - .add(CLOUDSBLUFF.getDefaultState(), 20) - .add(DRIGEAN.getDefaultState(), 3) - .add(LUMINAR.getDefaultState(), 8) - .add(ANCIENT_FLOWER.getDefaultState(), 1) - )); + // Shield + public static final RegistryKey> SHIELD_FOLIAGE = of("patch_shield_foliage"); + public static final RegistryKey> SHIELD_FLAX = of("patch_shield_flax"); - private static final RandomPatchFeatureConfig BLACKCURRANT_PATCH_CONFIG = blockPatch(42, 5, 5, BLACKCURRANT_BUSH.getDefaultState().with(Properties.AGE_3, 3)); - private static final RandomPatchFeatureConfig BROWN_SPORECAP_PATCH_CONFIG = blockPatch(8, 6, 4, BROWN_SPORECAP.getDefaultState()); - private static final BlockColumnFeatureConfig PINK_SPORECAP_PATCH_CONFIG = new BlockColumnFeatureConfig(List.of(BlockColumnFeatureConfig.createLayer(ConstantIntProvider.create(1), BlockStateProvider.of(PINK_SPORECAP.getDefaultState()))), Direction.DOWN, BlockPredicate.IS_AIR, true); - private static final BlockColumnFeatureConfig SWEDROOT_CONFIG = new BlockColumnFeatureConfig(List.of(BlockColumnFeatureConfig.createLayer(ConstantIntProvider.create(1), BlockStateProvider.of(DIRT.getDefaultState())), BlockColumnFeatureConfig.createLayer(ConstantIntProvider.create(1), BlockStateProvider.of(SWEDROOT.getDefaultState().with(CropBlock.AGE, 7)))), Direction.DOWN, BlockPredicate.IS_AIR, true); - // Plato - private static final RandomPatchFeatureConfig PLATEAU_FOLIAGE_CONFIG = blockPatch(96, 7, 3, new WeightedBlockStateProvider( - DataPool.builder() - .add(ParadiseLostBlocks.GRASS.getDefaultState(), 20) - .add(FERN.getDefaultState(), 15) - .add(ParadiseLostBlocks.BUSH.getDefaultState(), 13) - .add(GRASS_FLOWERING.getDefaultState(), 5) - )); - // Shield - private static final RandomPatchFeatureConfig SHIELD_FOLIAGE_CONFIG = blockPatch(64, 7, 3, new WeightedBlockStateProvider( - DataPool.builder() - .add(ParadiseLostBlocks.GRASS.getDefaultState(), 20) - .add(FERN.getDefaultState(), 15) - .add(ParadiseLostBlocks.BUSH.getDefaultState(), 13) - .add(GRASS_FLOWERING.getDefaultState(), 5) - )); + // Thicket + public static final RegistryKey> THICKET_LIVERWORT_CARPET = of("patch_thicket_liverwort_carpet"); + public static final RegistryKey> THICKET_SHAMROCK = of("patch_thicket_shamrock"); + //public static final RegistryEntry> THICKET_LIVERWORT_CARPET = register("patch_thicket_liverwort_carpet", ParadiseLostFeatures.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("patch_thicket_shamrock", ParadiseLostFeatures.ORGANIC_GROUNDCOVER_FEATURE, new ProjectedOrganicCoverConfig(BlockStateProvider.of(SHAMROCK), UniformIntProvider.create(2, 6), ConstantIntProvider.create(5), UniformIntProvider.create(4, 7), 1.3)); - private static final RandomPatchFeatureConfig SHIELD_FLAX_CONFIG = new RandomPatchFeatureConfig(96, 12, 5, - singleBlock(WILD_FLAX, BlockFilterPlacementModifier.of(BlockPredicate.matchingBlocks(Vec3i.ZERO.down(), List.of(FLOESTONE, COBBLED_FLOESTONE, MOSSY_FLOESTONE))), ParadiseLostPlacedFeatures.ON_SOLID_GROUND) - ); - // Tundra - private static final RandomPatchFeatureConfig TUNDRA_FOLIAGE_CONFIG = blockPatch(32, 7, 3, new WeightedBlockStateProvider( - DataPool.builder() - .add(SHORT_GRASS.getDefaultState(), 30) - .add(ParadiseLostBlocks.GRASS.getDefaultState(), 10) - .add(ParadiseLostBlocks.BUSH.getDefaultState(), 3) - )); + // Tundra + public static final RegistryKey> TUNDRA_FOLIAGE = of("patch_tundra_foliage"); - } + public static void init() {} } diff --git a/src/main/java/net/id/paradiselost/world/feature/placed_features/ParadiseLostVegetationPlacedFeatures.java b/src/main/java/net/id/paradiselost/world/feature/placed_features/ParadiseLostVegetationPlacedFeatures.java index 1f61d15e3..cfc5f9e29 100644 --- a/src/main/java/net/id/paradiselost/world/feature/placed_features/ParadiseLostVegetationPlacedFeatures.java +++ b/src/main/java/net/id/paradiselost/world/feature/placed_features/ParadiseLostVegetationPlacedFeatures.java @@ -23,7 +23,6 @@ public class ParadiseLostVegetationPlacedFeatures extends ParadiseLostPlacedFeat public static final RegistryEntry DENSE_BUSH = register("dense_bush", ParadiseLostVegetationConfiguredFeatures.DENSE_BUSH, CountMultilayerPlacementModifier.of(3), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); public static final RegistryEntry FLOWERS = register("flowers", ParadiseLostVegetationConfiguredFeatures.FLOWERS, CountPlacementModifier.of(3), RarityFilterPlacementModifier.of(32), SquarePlacementModifier.of(), HeightmapPlacementModifier.of(Heightmap.Type.MOTION_BLOCKING), BiomePlacementModifier.of()); public static final RegistryEntry GRASS = register("grass", ParadiseLostVegetationConfiguredFeatures.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 GRASS_BONEMEAL = register("grass_bonemeal", ParadiseLostVegetationConfiguredFeatures.GRASS_BONEMEAL, PlacedFeatures.isAir()); public static final RegistryEntry TALL_GRASS = register("tall_grass", ParadiseLostVegetationConfiguredFeatures.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 RegistryEntry PATCH_BLACKCURRANT = register("patch_blackcurrant", ParadiseLostVegetationConfiguredFeatures.PATCH_BLACKCURRANT, NOT_IN_SURFACE_WATER_MODIFIER, CountPlacementModifier.of(10), SquarePlacementModifier.of(), HeightRangePlacementModifier.uniform(YOffset.aboveBottom(0), YOffset.belowTop(0)), BiomePlacementModifier.of()); @@ -46,9 +45,6 @@ public class ParadiseLostVegetationPlacedFeatures extends ParadiseLostPlacedFeat public static final RegistryEntry THICKET_LIVERWORT_CARPET = register("thicket_liverwort_carpet", ParadiseLostVegetationConfiguredFeatures.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", ParadiseLostVegetationConfiguredFeatures.THICKET_SHAMROCK, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(8), CountMultilayerPlacementModifier.of(1), ON_SOLID_GROUND); - // ? - public static final RegistryEntry RAINBOW_MALT_SPRIGS = register("rainbow_malt_sprigs", ParadiseLostVegetationConfiguredFeatures.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/paradiselost/world/feature/placement_modifiers/ChancePlacementModifier.java b/src/main/java/net/id/paradiselost/world/feature/placement_modifiers/ChancePlacementModifier.java deleted file mode 100644 index c0489b01d..000000000 --- a/src/main/java/net/id/paradiselost/world/feature/placement_modifiers/ChancePlacementModifier.java +++ /dev/null @@ -1,37 +0,0 @@ -package net.id.paradiselost.world.feature.placement_modifiers; - -import com.mojang.serialization.Codec; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.intprovider.ConstantIntProvider; -import net.minecraft.util.math.intprovider.IntProvider; -import net.minecraft.util.math.random.Random; -import net.minecraft.world.gen.placementmodifier.AbstractCountPlacementModifier; -import net.minecraft.world.gen.placementmodifier.PlacementModifierType; - -// They removed the chance decorator in 1.18, so I've added it here. -public class ChancePlacementModifier extends AbstractCountPlacementModifier { - public static final Codec MODIFIER_CODEC = IntProvider.createValidatingCodec(0, 256) - .fieldOf("chance") - .xmap(ChancePlacementModifier::new, (chance) -> chance.chance) - .codec(); - - private final IntProvider chance; - - public ChancePlacementModifier(IntProvider chance) { - this.chance = chance; - } - - public static ChancePlacementModifier of(int chance) { - return new ChancePlacementModifier(ConstantIntProvider.create(chance)); - } - - @Override - protected int getCount(Random random, BlockPos pos) { - return random.nextFloat() < 1.0F / (float) chance.get(random) ? 1 : 0; - } - - @Override - public PlacementModifierType getType() { - return ParadiseLostPlacementModifiers.CHANCE; - } -} diff --git a/src/main/java/net/id/paradiselost/world/feature/placement_modifiers/ParadiseLostPlacementModifiers.java b/src/main/java/net/id/paradiselost/world/feature/placement_modifiers/ParadiseLostPlacementModifiers.java deleted file mode 100644 index d7524055d..000000000 --- a/src/main/java/net/id/paradiselost/world/feature/placement_modifiers/ParadiseLostPlacementModifiers.java +++ /dev/null @@ -1,20 +0,0 @@ -package net.id.paradiselost.world.feature.placement_modifiers; - -import com.mojang.serialization.Codec; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.world.gen.placementmodifier.PlacementModifier; -import net.minecraft.world.gen.placementmodifier.PlacementModifierType; - -import static net.id.paradiselost.ParadiseLost.locate; - -public final class ParadiseLostPlacementModifiers { - public static final PlacementModifierType CHANCE = register("chance", ChancePlacementModifier.MODIFIER_CODEC); - - private static

PlacementModifierType

register(String id, Codec

codec) { - return Registry.register(Registries.PLACEMENT_MODIFIER_TYPE, locate(id), () -> codec); - } - - public static void init() { - } -} diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/natural_swedroot.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/natural_swedroot.json new file mode 100644 index 000000000..349548663 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/natural_swedroot.json @@ -0,0 +1,34 @@ +{ + "type": "minecraft:block_column", + "config": { + "allowed_placement": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + }, + "direction": "down", + "layers": [ + { + "height": 1, + "provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:dirt" + } + } + }, + { + "height": 1, + "provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:swedroot", + "Properties": { + "age": "7" + } + } + } + } + ], + "prioritize_tip": true + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_blackcurrant.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_blackcurrant.json new file mode 100644 index 000000000..e8db11124 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_blackcurrant.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:blackcurrant_bush", + "Properties": { + "age": "3" + } + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 42, + "xz_spread": 5, + "y_spread": 5 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_brown_sporecap.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_brown_sporecap.json new file mode 100644 index 000000000..9112b2f64 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_brown_sporecap.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:brown_sporecap" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 8, + "xz_spread": 6, + "y_spread": 4 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_bush.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_bush.json new file mode 100644 index 000000000..9f1cd6d8b --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_bush.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:bush" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 128, + "xz_spread": 16, + "y_spread": 7 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_dense_bush.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_dense_bush.json new file mode 100644 index 000000000..3c34c11c8 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_dense_bush.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:bush" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 16, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_flowers.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_flowers.json new file mode 100644 index 000000000..08f118944 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_flowers.json @@ -0,0 +1,54 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "paradise_lost:ataraxia" + }, + "weight": 20 + }, + { + "data": { + "Name": "paradise_lost:cloudsbluff" + }, + "weight": 20 + }, + { + "data": { + "Name": "paradise_lost:drigean" + }, + "weight": 8 + }, + { + "data": { + "Name": "paradise_lost:luminar" + }, + "weight": 3 + }, + { + "data": { + "Name": "paradise_lost:ancient_flower" + }, + "weight": 1 + } + ] + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 64, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_grass.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_grass.json new file mode 100644 index 000000000..0885ef4aa --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_grass.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:grass_plant" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 32, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_pink_sporecap.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_pink_sporecap.json new file mode 100644 index 000000000..1e0956c1d --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_pink_sporecap.json @@ -0,0 +1,22 @@ +{ + "type": "minecraft:block_column", + "config": { + "allowed_placement": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + }, + "direction": "down", + "layers": [ + { + "height": 1, + "provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:pink_sporecap" + } + } + } + ], + "prioritize_tip": true + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_flowering_grass.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_flowering_grass.json new file mode 100644 index 000000000..569e38faa --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_flowering_grass.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:grass_flowering" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 128, + "xz_spread": 16, + "y_spread": 7 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_foliage.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_foliage.json new file mode 100644 index 000000000..55b619baa --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_foliage.json @@ -0,0 +1,48 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "paradise_lost:grass_plant" + }, + "weight": 20 + }, + { + "data": { + "Name": "paradise_lost:fern" + }, + "weight": 15 + }, + { + "data": { + "Name": "paradise_lost:bush" + }, + "weight": 13 + }, + { + "data": { + "Name": "paradise_lost:grass_flowering" + }, + "weight": 5 + } + ] + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 96, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_shamrock.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_shamrock.json new file mode 100644 index 000000000..9f2ef3022 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_plateau_shamrock.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:malt_sprig" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 128, + "xz_spread": 16, + "y_spread": 7 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_flax.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_flax.json new file mode 100644 index 000000000..8382e8fd8 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_flax.json @@ -0,0 +1,47 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:wild_flax", + "Properties": { + "half": "lower" + } + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:all_of", + "predicates": [ + { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + }, + { + "type": "minecraft:would_survive", + "state": { + "Name": "paradise_lost:wild_flax", + "Properties": { + "half": "lower" + } + } + } + ] + } + } + ] + }, + "tries": 96, + "xz_spread": 12, + "y_spread": 5 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_foliage.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_foliage.json new file mode 100644 index 000000000..55b619baa --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_shield_foliage.json @@ -0,0 +1,48 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "paradise_lost:grass_plant" + }, + "weight": 20 + }, + { + "data": { + "Name": "paradise_lost:fern" + }, + "weight": 15 + }, + { + "data": { + "Name": "paradise_lost:bush" + }, + "weight": 13 + }, + { + "data": { + "Name": "paradise_lost:grass_flowering" + }, + "weight": 5 + } + ] + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 96, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tall_grass.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tall_grass.json new file mode 100644 index 000000000..02ba69cf4 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tall_grass.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:tall_grass", + "Properties": { + "half": "lower" + } + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 32, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_liverwort_carpet.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_liverwort_carpet.json new file mode 100644 index 000000000..28640553c --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_liverwort_carpet.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:liverwort_carpet" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 128, + "xz_spread": 16, + "y_spread": 7 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_shamrock.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_shamrock.json new file mode 100644 index 000000000..efa2bd4bc --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_thicket_shamrock.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "paradise_lost:shamrock" + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 128, + "xz_spread": 16, + "y_spread": 7 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tundra_foliage.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tundra_foliage.json new file mode 100644 index 000000000..e4cf8cac5 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/patch_tundra_foliage.json @@ -0,0 +1,42 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "paradise_lost:grass_plant" + }, + "weight": 10 + }, + { + "data": { + "Name": "paradise_lost:short_grass" + }, + "weight": 30 + }, + { + "data": { + "Name": "paradise_lost:bush" + }, + "weight": 3 + } + ] + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 32, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/data/paradise_lost/worldgen/configured_feature/shield_nettles.json b/src/main/resources/data/paradise_lost/worldgen/configured_feature/shield_nettles.json new file mode 100644 index 000000000..b30373060 --- /dev/null +++ b/src/main/resources/data/paradise_lost/worldgen/configured_feature/shield_nettles.json @@ -0,0 +1,4 @@ +{ + "type": "minecraft:honey_nettle", + "config": {} +} \ No newline at end of file