Skip to content

Commit

Permalink
convert misc features
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 11, 2024
1 parent cd8cd5a commit ea22b1f
Show file tree
Hide file tree
Showing 23 changed files with 436 additions and 86 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ParadiseLostFeatures {
public static final ParadiseLostDeltaFeature DELTA_FEATURE = register("delta_feature", new ParadiseLostDeltaFeature(DeltaFeatureConfig.CODEC));
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_feature", new VitrouliteSpireFeature(DefaultFeatureConfig.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));
Expand All @@ -31,8 +31,8 @@ public class ParadiseLostFeatures {
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));

public static final JaggedOreFeature JAGGED_ORE = register("jagged_ore_feature", new JaggedOreFeature(JaggedOreConfig.CODEC));
public static final SurtrumMeteoriteFeature SURTRUM_METEORITE_FEATURE = register("surtrum_meteorite_feature", new SurtrumMeteoriteFeature(DefaultFeatureConfig.CODEC));
public static final JaggedOreFeature JAGGED_ORE = register("jagged_ore", new JaggedOreFeature(JaggedOreConfig.CODEC));
public static final SurtrumMeteoriteFeature SURTRUM_METEORITE_FEATURE = register("surtrum_meteorite", new SurtrumMeteoriteFeature(DefaultFeatureConfig.CODEC));

private static <C extends FeatureConfig, F extends Feature<C>> F register(String id, F feature) {
return Registry.register(Registries.FEATURE, ParadiseLost.locate(id), feature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public record JaggedOreConfig(BlockStateProvider block, IntProvider height, IntP
IntProvider.VALUE_CODEC.fieldOf("height").forGetter(JaggedOreConfig::height),
IntProvider.VALUE_CODEC.fieldOf("width").forGetter(JaggedOreConfig::width),
IntProvider.VALUE_CODEC.fieldOf("length").forGetter(JaggedOreConfig::length),
IntProvider.VALUE_CODEC.fieldOf("lengthOffset").forGetter(JaggedOreConfig::lengthOffset)
IntProvider.VALUE_CODEC.fieldOf("length_offset").forGetter(JaggedOreConfig::lengthOffset)
).apply(instance, JaggedOreConfig::new));
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
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;
Expand All @@ -33,86 +34,27 @@ public class ParadiseLostMiscConfiguredFeatures extends ParadiseLostConfiguredFe
Highlands
*/
// Default
public static final RegistryEntry<ConfiguredFeature<SpringFeatureConfig, ?>> WATER_SPRING = register("water_spring", Feature.SPRING_FEATURE, Configs.WATER_SPRING_CONFIG);
public static final RegistryKey<ConfiguredFeature<?, ?>> WATER_SPRING = of("spring_water");

public static final RegistryEntry<ConfiguredFeature<BoulderFeatureConfig, ?>> GENERIC_BOULDER = register("generic_boulder", ParadiseLostFeatures.BOULDER, Configs.GENERIC_BOULDER_CONFIG);
public static final RegistryEntry<ConfiguredFeature<BoulderFeatureConfig, ?>> PLAINS_BOULDER = register("plains_boulder", ParadiseLostFeatures.BOULDER, Configs.PLAINS_BOULDER_CONFIG);
public static final RegistryEntry<ConfiguredFeature<BoulderFeatureConfig, ?>> THICKET_BOULDER = register("thicket_boulder", ParadiseLostFeatures.BOULDER, Configs.THICKET_BOULDER_CONFIG);
public static final RegistryEntry<ConfiguredFeature<BoulderFeatureConfig, ?>> GOLDEN_BOULDER = register("golden_boulder", ParadiseLostFeatures.BOULDER, Configs.GOLDEN_BOULDER_CONFIG);
public static final RegistryKey<ConfiguredFeature<?, ?>> GENERIC_BOULDER = of("generic_boulder");
public static final RegistryKey<ConfiguredFeature<?, ?>> PLAINS_BOULDER = of("plains_boulder");
public static final RegistryKey<ConfiguredFeature<?, ?>> THICKET_BOULDER = of("thicket_boulder");
public static final RegistryKey<ConfiguredFeature<?, ?>> GOLDEN_BOULDER = of("golden_boulder");

public static final RegistryEntry<ConfiguredFeature<JaggedOreConfig, ?>> HELIOLITH_BLOB = register("heliolith_blob", ParadiseLostFeatures.JAGGED_ORE, Configs.HELIOLITH_BLOB_CONFIG);
public static final RegistryEntry<ConfiguredFeature<JaggedOreConfig, ?>> LEVITA_BLOB = register("levita_blob", ParadiseLostFeatures.JAGGED_ORE, Configs.LEVITA_BLOB_CONFIG);
public static final RegistryEntry<ConfiguredFeature<OreFeatureConfig, ?>> ORE_CHERINE = register("ore_cherine", Feature.ORE, Configs.ore(CHERINE_ORE, 14));
public static final RegistryEntry<ConfiguredFeature<OreFeatureConfig, ?>> ORE_OLVITE = register("ore_olvite", Feature.ORE, Configs.ore(OLVITE_ORE, 9));
public static final RegistryEntry<ConfiguredFeature<OreFeatureConfig, ?>> ORE_LEVITA = register("ore_levita", Feature.ORE, Configs.ore(LEVITA_ORE, 3));
public static final RegistryEntry<ConfiguredFeature<DefaultFeatureConfig, ?>> SURTRUM_METEORITE = register("surtrum_meteorite", ParadiseLostFeatures.SURTRUM_METEORITE_FEATURE, new DefaultFeatureConfig());
// Plato
// Shield
public static final RegistryEntry<ConfiguredFeature<RandomPatchFeatureConfig, ?>> SHIELD_ROCKS = register("shield_rocks", Feature.RANDOM_PATCH, Configs.SHIELD_ROCKS_CONFIG);

public static final RegistryEntry<ConfiguredFeature<DeltaFeatureConfig, ?>> SHIELD_PONDS = register("shield_pond", ParadiseLostFeatures.DELTA_FEATURE, new DeltaFeatureConfig(Blocks.WATER.getDefaultState(), COBBLED_FLOESTONE_SLAB.getDefaultState().with(SlabBlock.TYPE, SlabType.BOTTOM).with(Properties.WATERLOGGED, true), UniformIntProvider.create(2, 7), UniformIntProvider.create(1, 2)));

public static final RegistryEntry<ConfiguredFeature<GroundcoverFeatureConfig, ?>> SHIELD_PODZOL = register("shield_podzol", ParadiseLostFeatures.GROUNDCOVER_FEATURE, new GroundcoverFeatureConfig(BlockStateProvider.of(FROZEN_GRASS), UniformIntProvider.create(2, 3), UniformIntProvider.create(0, 0)));
// Tundra
public static final RegistryEntry<ConfiguredFeature<DefaultFeatureConfig, ?>> TUNDRA_SPIRES = register("tundra_spires", ParadiseLostFeatures.VITROULITE_SPIRE_FEATURE, FeatureConfig.DEFAULT);

public static final RegistryEntry<ConfiguredFeature<DeltaFeatureConfig, ?>> TUNDRA_PONDS = register("tundra_pond", ParadiseLostFeatures.DELTA_FEATURE, new DeltaFeatureConfig(Blocks.ICE.getDefaultState(), Blocks.PACKED_ICE.getDefaultState(), UniformIntProvider.create(4, 9), UniformIntProvider.create(0, 1)));
public static final RegistryEntry<ConfiguredFeature<DeltaFeatureConfig, ?>> TUNDRA_SNOW = register("tundra_snow", ParadiseLostFeatures.DELTA_FEATURE, new DeltaFeatureConfig(Blocks.POWDER_SNOW.getDefaultState(), Blocks.SNOW_BLOCK.getDefaultState(), UniformIntProvider.create(3, 8), UniformIntProvider.create(0, 1)));

public static final RegistryEntry<ConfiguredFeature<DefaultFeatureConfig, ?>> FREEZE_TOP_LAYER = register("freeze_top_layer", ParadiseLostFeatures.FREEZE_TOP_LAYER_FEATURE_FEATURE, FeatureConfig.DEFAULT);

// TODO 1.7 uncomment public static final RegistryEntry<ConfiguredFeature<DynamicConfiguration, ?>> LAKE = register("lake", ParadiseLostFeatures.LAKE, new DynamicConfiguration(Blocks.WATER.getDefaultState(), Optional.of("normal")));
public static final RegistryKey<ConfiguredFeature<?, ?>> HELIOLITH_BLOB = of("heliolith_blob");
public static final RegistryKey<ConfiguredFeature<?, ?>> LEVITA_BLOB = of("levita_blob");
public static final RegistryKey<ConfiguredFeature<?, ?>> ORE_CHERINE = of("ore_cherine");
public static final RegistryKey<ConfiguredFeature<?, ?>> ORE_OLVITE = of("ore_olvite");
public static final RegistryKey<ConfiguredFeature<?, ?>> ORE_LEVITA = of("ore_levita");
public static final RegistryKey<ConfiguredFeature<?, ?>> SURTRUM_METEORITE = of("surtrum_meteorite");

public static void init() {
}

private static class Configs extends ParadiseLostConfiguredFeatures.Configs {
private static final SpringFeatureConfig WATER_SPRING_CONFIG = new SpringFeatureConfig(Fluids.WATER.getDefaultState(), true, 4, 1, RegistryEntryList.of(Block::getRegistryEntry, FLOESTONE));

private static final RandomPatchFeatureConfig SHIELD_ROCKS_CONFIG = new RandomPatchFeatureConfig(48, 9, 3, PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(new WeightedBlockStateProvider(
DataPool.<BlockState>builder()
.add(COBBLED_FLOESTONE_SLAB.getDefaultState().with(SlabBlock.TYPE, SlabType.BOTTOM), 10)
.add(COBBLED_FLOESTONE.getDefaultState(), 4)
.build())
), BlockFilterPlacementModifier.of(ParadiseLostPlacedFeatures.IN_OR_ON_GROUND)));

private static BoulderFeatureConfig boulder(BlockStateProvider provider, int tries, IntProvider size) {
return new BoulderFeatureConfig(BlockStateProvider.of(COBBLED_FLOESTONE), ConstantIntProvider.create(tries), size);
}
private static BoulderFeatureConfig boulder(Block block, int tries, IntProvider size) {
return boulder(BlockStateProvider.of(block), tries, size);
}

private static final JaggedOreConfig HELIOLITH_BLOB_CONFIG =
new JaggedOreConfig(BlockStateProvider.of(HELIOLITH), UniformIntProvider.create(4, 7), UniformIntProvider.create(7, 11), UniformIntProvider.create(5, 11), UniformIntProvider.create(1, 4));
private static final JaggedOreConfig LEVITA_BLOB_CONFIG =
new JaggedOreConfig(new WeightedBlockStateProvider(
DataPool.<BlockState>builder()
.add(LEVITA.getDefaultState(), 200)
.add(LEVITA_ORE.getDefaultState(), 1)
), UniformIntProvider.create(3, 5), UniformIntProvider.create(6, 10), UniformIntProvider.create(4, 10), UniformIntProvider.create(3, 6));

private static final BoulderFeatureConfig GENERIC_BOULDER_CONFIG = boulder(new WeightedBlockStateProvider(
DataPool.<BlockState>builder()
.add(MOSSY_FLOESTONE.getDefaultState(), 1)
.add(COBBLED_FLOESTONE.getDefaultState(), 3)
), 4, UniformIntProvider.create(3, 6));

private static final BoulderFeatureConfig PLAINS_BOULDER_CONFIG = boulder(COBBLED_FLOESTONE, 3, UniformIntProvider.create(3, 5));
private static final BoulderFeatureConfig THICKET_BOULDER_CONFIG = boulder(new WeightedBlockStateProvider(
DataPool.<BlockState>builder()
.add(MOSSY_FLOESTONE.getDefaultState(), 4)
.add(COBBLED_FLOESTONE.getDefaultState(), 1)
), 6, UniformIntProvider.create(2, 5));
// Shield
public static final RegistryKey<ConfiguredFeature<?, ?>> SHIELD_ROCKS = of("shield_rocks");
public static final RegistryKey<ConfiguredFeature<?, ?>> SHIELD_PONDS = of("shield_pond");
public static final RegistryKey<ConfiguredFeature<?, ?>> TUNDRA_SPIRES = of("tundra_spires");
public static final RegistryKey<ConfiguredFeature<?, ?>> TUNDRA_PONDS = of("tundra_pond");
public static final RegistryKey<ConfiguredFeature<?, ?>> TUNDRA_SNOW = of("tundra_snow");

private static final BoulderFeatureConfig GOLDEN_BOULDER_CONFIG = boulder(new WeightedBlockStateProvider(
DataPool.<BlockState>builder()
.add(GOLDEN_MOSSY_FLOESTONE.getDefaultState(), 4)
.add(COBBLED_FLOESTONE.getDefaultState(), 1)
), 4, UniformIntProvider.create(3, 5));
public static void init() {}

private static OreFeatureConfig ore(Block ore, int size) {
return new OreFeatureConfig(List.of(OreFeatureConfig.createTarget(new BlockMatchRuleTest(FLOESTONE), ore.getDefaultState())), size);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class ParadiseLostTreeConfiguredFeatures extends ParadiseLostConfiguredFe
public static final RegistryKey<ConfiguredFeature<?, ?>> FANCY_LAVENDER_WISTERIA_TREE = of("tree_fancy_lavender_wisteria");
public static final RegistryKey<ConfiguredFeature<?, ?>> FANCY_FROST_WISTERIA_TREE = of("tree_fancy_frost_wisteria");
public static final RegistryKey<ConfiguredFeature<?, ?>> AUREL_SHRUB = of("aurel_shrub");
RandomPatchFeatureConfig

// Fallen leaves
public static final RegistryKey<ConfiguredFeature<?, ?>> FALLEN_LEAVES = of("fallen_leaves");
public static final RegistryKey<ConfiguredFeature<?, ?>> FALLEN_ROSE_LEAVES = of("fallen_rose_leaves");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public class ParadiseLostMiscPlacedFeatures extends ParadiseLostPlacedFeatures {

public static final RegistryEntry<PlacedFeature> SHIELD_PONDS = register("shield_pond", ParadiseLostMiscConfiguredFeatures.SHIELD_PONDS, CountMultilayerPlacementModifier.of(19), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));

public static final RegistryEntry<PlacedFeature> SHIELD_PODZOL = register("shield_podzol", ParadiseLostMiscConfiguredFeatures.SHIELD_PODZOL, CountMultilayerPlacementModifier.of(2), ChancePlacementModifier.of(15), CountPlacementModifier.of(UniformIntProvider.create(0, 2)));
// Tundra
public static final RegistryEntry<PlacedFeature> TUNDRA_SPIRES = register("tundra_spires", ParadiseLostMiscConfiguredFeatures.TUNDRA_SPIRES, ChancePlacementModifier.of(14), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 10)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.blockpredicate.BlockPredicate;
import net.minecraft.world.gen.feature.ConfiguredFeature;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ParadiseLostTreePlacedFeatures extends ParadiseLostPlacedFeatures {
public static final RegistryEntry<PlacedFeature> RAINBOW_FOREST_TREES = register("wisteria_woods_trees", ParadiseLostTreeConfiguredFeatures.RAINBOW_FOREST_TREES, CountMultilayerPlacementModifier.of(17), CountPlacementModifier.of(UniformIntProvider.create(0, 4)));
// Fallen leaves
public static final RegistryEntry<PlacedFeature> FALLEN_LEAVES = register("fallen_leaves", ParadiseLostTreeConfiguredFeatures.FALLEN_LEAVES, SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));
public static final RegistryEntry<PlacedFeature> ALT_FALLEN_LEAVES = register("alt_fallen_leaves", ParadiseLostTreeConfiguredFeatures.ALT_FALLEN_LEAVES, SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));
public static final RegistryEntry<PlacedFeature> ALT_FALLEN_LEAVES = register("alt_fallen_leaves", ParadiseLostTreeConfiguredFeatures.FALLEN_LEAVES, SPREAD_32_ABOVE, PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, CountPlacementModifier.of(3), ChancePlacementModifier.of(5), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));

public static final RegistryEntry<PlacedFeature> FALLEN_ROSE_LEAVES = register("fallen_rose_leaves", ParadiseLostTreeConfiguredFeatures.FALLEN_ROSE_LEAVES, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3)), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));
public static final RegistryEntry<PlacedFeature> FALLEN_LAVENDER_LEAVES = register("fallen_lavender_leaves", ParadiseLostTreeConfiguredFeatures.FALLEN_LAVENDER_LEAVES, PlacedFeatures.BOTTOM_TO_TOP_RANGE, ChancePlacementModifier.of(2), CountMultilayerPlacementModifier.of(1), CountPlacementModifier.of(UniformIntProvider.create(0, 3)), HeightmapPlacementModifier.of(Heightmap.Type.WORLD_SURFACE));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "paradise_lost:boulder",
"config": {
"body": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "paradise_lost:cobbled_floestone"
},
"weight": 3
},
{
"data": {
"Name": "paradise_lost:mossy_floestone"
},
"weight": 1
}
]
},
"tries": 4,
"size": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 6,
"min_inclusive": 3
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "paradise_lost:boulder",
"config": {
"body": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "paradise_lost:cobbled_floestone"
},
"weight": 1
},
{
"data": {
"Name": "paradise_lost:golden_mossy_floestone"
},
"weight": 3
}
]
},
"tries": 4,
"size": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 5,
"min_inclusive": 3
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"type": "paradise_lost:jagged_ore",
"config": {
"block": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "paradise_lost:heliolith"
}
},
"height": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 7,
"min_inclusive": 4
}
},
"width": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 11,
"min_inclusive": 7
}
},
"length": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 11,
"min_inclusive": 5
}
},
"length_offset": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 4,
"min_inclusive": 1
}
},
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"type": "paradise_lost:jagged_ore",
"config": {
"block": {
"type": "minecraft:weighted_state_provider",
"entries": [
{
"data": {
"Name": "paradise_lost:levita"
},
"weight": 150
},
{
"data": {
"Name": "paradise_lost:levita_ore"
},
"weight": 1
}
]
},
"height": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 5,
"min_inclusive": 3
}
},
"width": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 10,
"min_inclusive": 6
}
},
"length": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 10,
"min_inclusive": 4
}
},
"length_offset": {
"type": "minecraft:uniform",
"value": {
"max_inclusive": 6,
"min_inclusive": 3
}
},
}
}
Loading

0 comments on commit ea22b1f

Please sign in to comment.