From 142b72e9f966f615ee98abe63d913218efed76c4 Mon Sep 17 00:00:00 2001 From: ticccco <23436953+LucasPlacentino@users.noreply.github.com> Date: Sat, 31 Dec 2022 17:35:31 +0100 Subject: [PATCH] tryna fix custom ore gen --- .../mcsc/world/feature/ModConfiguredFeatures.java | 9 +++++++++ .../mcsc/world/feature/ModPlacedFeatures.java | 15 ++++++++------- .../worldgen/placed_feature/ore_borax.json | 6 +++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/obsilab/mcsc/world/feature/ModConfiguredFeatures.java b/src/main/java/com/obsilab/mcsc/world/feature/ModConfiguredFeatures.java index e1d1471..da1aac2 100644 --- a/src/main/java/com/obsilab/mcsc/world/feature/ModConfiguredFeatures.java +++ b/src/main/java/com/obsilab/mcsc/world/feature/ModConfiguredFeatures.java @@ -47,6 +47,15 @@ public class ModConfiguredFeatures { 10 // vein size ))); */ + // public static final RegistryObject BORAX_ORE = + // CONFIGURED_FEATURES.register("borax_ore", + // () -> new OreFeatures(new OreConfiguration( + // new TagMatchTest(BlockTags.BASE_STONE_OVERWORLD), + // ModBlocks.BORAX_ORE.get().defaultBlockState(), + // 10 // vein size + // ) + // )); + public static final ResourceKey> ORE_BORAX = FeatureUtils.createKey("ore_borax"); diff --git a/src/main/java/com/obsilab/mcsc/world/feature/ModPlacedFeatures.java b/src/main/java/com/obsilab/mcsc/world/feature/ModPlacedFeatures.java index 031280b..b3da1ee 100644 --- a/src/main/java/com/obsilab/mcsc/world/feature/ModPlacedFeatures.java +++ b/src/main/java/com/obsilab/mcsc/world/feature/ModPlacedFeatures.java @@ -2,6 +2,7 @@ import com.obsilab.mcsc.MCSC; import net.minecraft.core.registries.Registries; +import net.minecraft.data.worldgen.features.FeatureUtils; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.placement.*; import net.minecraftforge.eventbus.api.IEventBus; @@ -14,13 +15,13 @@ public class ModPlacedFeatures { public static final DeferredRegister PLACED_FEATURES = DeferredRegister.create(Registries.PLACED_FEATURE, MCSC.MOD_ID); - public static final RegistryObject BORAX_ORE_PLACED = PLACED_FEATURES.register("borax_ore_placed", - () -> new PlacedFeature(ModConfiguredFeatures.BORAX_ORE.getHolder().get(), - commonOrePlacement(6, // VeinsPerChunk - HeightRangePlacement.triangle( - VerticalAnchor.absolute(0), - VerticalAnchor.absolute(160) - )))); + // public static final RegistryObject BORAX_ORE_PLACED = PLACED_FEATURES.register("borax_ore_placed", + // () -> new PlacedFeature(ModConfiguredFeatures.BORAX_ORE.getHolder().get(), + // commonOrePlacement(6, // VeinsPerChunk + // HeightRangePlacement.triangle( + // VerticalAnchor.absolute(0), + // VerticalAnchor.absolute(160) + // )))); public static List orePlacement(PlacementModifier placementModifier, PlacementModifier placementModifier1) { diff --git a/src/main/resources/data/minecraft/worldgen/placed_feature/ore_borax.json b/src/main/resources/data/minecraft/worldgen/placed_feature/ore_borax.json index 5cb47e6..edd915f 100644 --- a/src/main/resources/data/minecraft/worldgen/placed_feature/ore_borax.json +++ b/src/main/resources/data/minecraft/worldgen/placed_feature/ore_borax.json @@ -11,12 +11,12 @@ { "type": "minecraft:height_range", "height": { - "type": "minecraft:uniform", + "type": "minecraft:triangle", "max_inclusive": { - "below_top": 0 + "absolute": 160 }, "min_inclusive": { - "absolute": 136 + "absolute": 0 } } },