Jump to content

TeineOne

Members
  • Posts

    3
  • Joined

  • Last visited

TeineOne's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I fixed it all up, I didn't realize it was trying to generate them in the same veins...
  2. Alright, thank you. I thought it had something to do with the order of how they were written, but wasn't sure. I'll avoid posting code snippets on the forum from now on.
  3. I'm making a mod that adds various ores and materials to the game. Some of (not all) of the materials are failing to generate, and I can't figure it out for the life of me. It's been two days of trying to figure it out myself, but nothing's worked so I came here. The Configured Features class (the ores that work are the following - Tin, Deepslate Tin, Crimson Shroomite, and Chorite): package com.teineone.new_world.world.feature; import com.google.common.base.Suppliers; import com.teineone.new_world.NewWorld; import com.teineone.new_world.block.ModBlocks; import net.minecraft.core.Registry; import net.minecraft.data.worldgen.features.OreFeatures; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.structure.templatesystem.BlockMatchTest; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.RegistryObject; import java.util.List; import java.util.function.Supplier; public class ModConfiguredFeatures { public static final DeferredRegister<ConfiguredFeature<?, ?>> CONFIGURED_FEATURES = DeferredRegister.create(Registry.CONFIGURED_FEATURE_REGISTRY, NewWorld.MOD_ID); public static final Supplier<List<OreConfiguration.TargetBlockState>> OVERWORLD_ORES = Suppliers.memoize(() -> List.of( OreConfiguration.target(OreFeatures.STONE_ORE_REPLACEABLES, ModBlocks.TIN_ORE.get().defaultBlockState()), OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, ModBlocks.DEEPSLATE_TIN_ORE.get().defaultBlockState()), OreConfiguration.target(OreFeatures.DEEPSLATE_ORE_REPLACEABLES, ModBlocks.MITHRIL_ORE.get().defaultBlockState()))); public static final Supplier<List<OreConfiguration.TargetBlockState>> NETHER_ORES = Suppliers.memoize(() -> List.of( OreConfiguration.target(OreFeatures.NETHER_ORE_REPLACEABLES, ModBlocks.CRIMSON_SHROOMITE_ORE.get().defaultBlockState()), OreConfiguration.target(OreFeatures.NETHER_ORE_REPLACEABLES, ModBlocks.WARPED_SHROOMITE_ORE.get().defaultBlockState()), OreConfiguration.target(OreFeatures.NETHER_ORE_REPLACEABLES, ModBlocks.TITANIUM_ORE.get().defaultBlockState()))); public static final Supplier<List<OreConfiguration.TargetBlockState>> END_ORES = Suppliers.memoize(() -> List.of( OreConfiguration.target(new BlockMatchTest(Blocks.END_STONE), ModBlocks.CHORITE_ORE.get().defaultBlockState()), OreConfiguration.target(new BlockMatchTest(Blocks.END_STONE), ModBlocks.TUNGSTEN_ORE.get().defaultBlockState()), OreConfiguration.target(new BlockMatchTest(Blocks.END_STONE), ModBlocks.ADAMANTINE_ORE.get().defaultBlockState()))); public static final RegistryObject<ConfiguredFeature<?, ?>> TIN_ORE = CONFIGURED_FEATURES.register("tin_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_ORES.get(), 7))); public static final RegistryObject<ConfiguredFeature<?, ?>> DEEPSLATE_TIN_ORE = CONFIGURED_FEATURES.register("deepslate_tin_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_ORES.get(), 7))); public static final RegistryObject<ConfiguredFeature<?, ?>> MITHRIL_ORE = CONFIGURED_FEATURES.register("mithril_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(OVERWORLD_ORES.get(), 7))); public static final RegistryObject<ConfiguredFeature<?, ?>> CRIMSON_SHROOMITE_ORE = CONFIGURED_FEATURES.register("crimson_shroomite_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(NETHER_ORES.get(), 9))); public static final RegistryObject<ConfiguredFeature<?, ?>> WARPED_SHROOMITE_ORE = CONFIGURED_FEATURES.register("warped_shroomite_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(NETHER_ORES.get(), 9))); public static final RegistryObject<ConfiguredFeature<?, ?>> TITANIUM_ORE = CONFIGURED_FEATURES.register("titanium_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(NETHER_ORES.get(), 7))); public static final RegistryObject<ConfiguredFeature<?, ?>> CHORITE_ORE = CONFIGURED_FEATURES.register("chorite_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(END_ORES.get(), 9))); public static final RegistryObject<ConfiguredFeature<?, ?>> TUNGSTEN_ORE = CONFIGURED_FEATURES.register("tungsten_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(END_ORES.get(), 7))); public static final RegistryObject<ConfiguredFeature<?, ?>> ADAMANTINE_ORE = CONFIGURED_FEATURES.register("adamantine_ore", () -> new ConfiguredFeature<>(Feature.ORE, new OreConfiguration(END_ORES.get(), 7))); public static void register(IEventBus eventBus) { CONFIGURED_FEATURES.register(eventBus); } } The placed features class (again, functioning ores are mentioned above): package com.teineone.new_world.world.feature; import com.teineone.new_world.NewWorld; import net.minecraft.core.Registry; import net.minecraft.world.level.levelgen.VerticalAnchor; import net.minecraft.world.level.levelgen.placement.*; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.RegistryObject; import java.util.List; public class ModPlacedFeatures { public static final DeferredRegister<PlacedFeature> PLACED_FEATURES = DeferredRegister.create(Registry.PLACED_FEATURE_REGISTRY, NewWorld.MOD_ID); public static final RegistryObject<PlacedFeature> TIN_ORE_PLACED = PLACED_FEATURES.register("tin_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.TIN_ORE.getHolder().get(), commonOrePlacement(18, HeightRangePlacement.triangle(VerticalAnchor.absolute(-0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> DEEPSLATE_TIN_ORE_PLACED = PLACED_FEATURES.register("deepslate_tin_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.DEEPSLATE_TIN_ORE.getHolder().get(), commonOrePlacement(12, HeightRangePlacement.triangle(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(0))))); public static final RegistryObject<PlacedFeature> MITHRIL_ORE_PLACED = PLACED_FEATURES.register("mithril_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.MITHRIL_ORE.getHolder().get(), commonOrePlacement(12, HeightRangePlacement.triangle(VerticalAnchor.absolute(-64), VerticalAnchor.absolute(0))))); public static final RegistryObject<PlacedFeature> CRIMSON_SHROOMITE_ORE_PLACED = PLACED_FEATURES.register("crimson_shroomite_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.CRIMSON_SHROOMITE_ORE.getHolder().get(), commonOrePlacement(12, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> WARPED_SHROOMITE_ORE_PLACED = PLACED_FEATURES.register("warped_shroomite_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.WARPED_SHROOMITE_ORE.getHolder().get(), commonOrePlacement(12, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> TITANIUM_ORE_PLACED = PLACED_FEATURES.register("titanium_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.TITANIUM_ORE.getHolder().get(), commonOrePlacement(7, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> CHORITE_ORE_PLACED = PLACED_FEATURES.register("chorite_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.CHORITE_ORE.getHolder().get(), commonOrePlacement(7, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> TUNGSTEN_ORE_PLACED = PLACED_FEATURES.register("tungsten_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.TUNGSTEN_ORE.getHolder().get(), commonOrePlacement(7, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static final RegistryObject<PlacedFeature> ADAMANTINE_ORE_PLACED = PLACED_FEATURES.register("adamantine_ore_placed", () -> new PlacedFeature(ModConfiguredFeatures.ADAMANTINE_ORE.getHolder().get(), commonOrePlacement(7, HeightRangePlacement.triangle(VerticalAnchor.absolute(0), VerticalAnchor.absolute(128))))); public static List<PlacementModifier> orePlacement(PlacementModifier p_195347_, PlacementModifier p_195348_) { return List.of(p_195347_, InSquarePlacement.spread(), p_195348_, BiomeFilter.biome()); } public static List<PlacementModifier> commonOrePlacement(int p_195344_, PlacementModifier p_195345_) { return orePlacement(CountPlacement.of(p_195344_), p_195345_); } public static List<PlacementModifier> rareOrePlacement(int p_195350_, PlacementModifier p_195351_) { return orePlacement(RarityFilter.onAverageOnceEvery(p_195350_), p_195351_); } public static void register(IEventBus eventBus) { PLACED_FEATURES.register(eventBus); } } All of the .json files for ore generation function, as they're literal copies of each other and the game generates worlds without coming up with a "datapacks invalid" error. Ore counts are greatly exaggerated as a response to them not generating, me being me, I just thought they were too rare. Nope. Side note: It may have something to do with the supplier creation in ConfiguredFeatures? I've tried a bunch of stuff on it and nothing's worked, but I've noticed that the ores that don't generate are lower down in the declarations. Any and all help is appreciated, and thank you ahead of time.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.