Jump to content

Ore Generation In the END 1.16


Dmitrium12

Recommended Posts

I want my ore to be generated in the end. I did this:

@Mod.EventBusSubscriber(modid = MODID)
public class OreGeneration2 {

    private static ConfiguredFeature oreConfiguredFeature;

    private static ConfiguredFeature oreConfiguredFeature() {
        if (oreConfiguredFeature == null) {
            oreConfiguredFeature = new ReplaceBlockFeature(ReplaceBlockConfig.CODEC) {
                @Override
                public boolean generate(ISeedReader reader, ChunkGenerator generator, Random rand, BlockPos pos, ReplaceBlockConfig config) {
                    return super.generate(reader, generator, rand, pos, config);
                }
            }.withConfiguration(new ReplaceBlockConfig(Blocks.END_STONE.getDefaultState(), RegistryHandler.CATAZ_END_ORE.get().getDefaultState()))
                    .withPlacement(new Height4To32(NoPlacementConfig.CODEC) {
                        @Override
                        public Stream<BlockPos> getPositions(Random random, NoPlacementConfig config, BlockPos pos) {
                            return IntStream.range(200, 201 + random.nextInt(3)).mapToObj((count) -> {
                                int j = random.nextInt(16) + pos.getX();
                                int k = random.nextInt(16) + pos.getZ();
                                int startY = 1;
                                int endY = 255;
                                int l = startY+random.nextInt(endY-startY+1);
                                return new BlockPos(j, l, k);
                            });
                        }
                    }.configure(IPlacementConfig.NO_PLACEMENT_CONFIG));
        }

        return oreConfiguredFeature;
    }

    @SubscribeEvent
    public static void registerOreAtBiomes(BiomeLoadingEvent event) {
        if (event.getCategory().equals(Biome.Category.THEEND)) {
            event.getGeneration().withFeature(GenerationStage.Decoration.UNDERGROUND_ORES, oreConfiguredFeature());
        }
    }

}

It is not generated. Tell me where I screwed up.

Edited by Dmitrium12
didn't specify the version
Link to comment
Share on other sites

  • Dmitrium12 changed the title to Ore Generation In the END 1.16
  • 10 months later...
On 6/2/2021 at 1:59 PM, Dmitrium12 said:
    @SubscribeEvent
    public static void registerOreAtBiomes(BiomeLoadingEvent event) {
        if (event.getCategory().equals(Biome.Category.THEEND)) {
            event.getGeneration().withFeature(GenerationStage.Decoration.UNDERGROUND_ORES, oreConfiguredFeature());
        }
    }

this should work, if not create your own thread (show your code) since this thread is ancient

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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