Jump to content

[1.16.3] Custom Plant No longer Generating.


Pickle_Face5

Recommended Posts

I'm trying to make a berry bush that generates in forests and plains (more common in forests), and now it doesn't generate at all.

Here's the code:

package com.pickleface.lifecraft.world.gen;

import com.google.common.collect.ImmutableSet;
import com.pickleface.lifecraft.LifeCraft;
import com.pickleface.lifecraft.blocks.BlueberryBush;
import com.pickleface.lifecraft.util.Registry;
import net.minecraft.block.Blocks;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage;
import net.minecraft.world.gen.blockplacer.SimpleBlockPlacer;
import net.minecraft.world.gen.blockstateprovider.SimpleBlockStateProvider;
import net.minecraft.world.gen.feature.*;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = LifeCraft.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class VeganGen {

    @SubscribeEvent
    public static void generateBushes(BiomeLoadingEvent event) {
        BlockClusterFeatureConfig BLUEBERRY_BUSH_PATCH_CONFIG = (new BlockClusterFeatureConfig.Builder(new SimpleBlockStateProvider(Registry.BLUEBERRY_BUSH.get().getDefaultState().with(BlueberryBush.AGE, 3)), SimpleBlockPlacer.PLACER)).tries(64).whitelist(ImmutableSet.of(Blocks.GRASS_BLOCK.getDefaultState().getBlock())).func_227317_b_().build();

        ConfiguredFeature<?, ?> PATCH_BLUEBERRY_BUSH = Feature.RANDOM_PATCH.withConfiguration(BLUEBERRY_BUSH_PATCH_CONFIG);
        ConfiguredFeature<?, ?> PATCH_BLUEBERRY_DECORATED = PATCH_BLUEBERRY_BUSH.withPlacement(Features.Placements.PATCH_PLACEMENT).chance(24);

        if (event.getCategory().getString().equals("forest")) {
            event.getGeneration().withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, PATCH_BLUEBERRY_DECORATED);
        } else if (event.getCategory().getString().equals("plains")) {
            event.getGeneration().withFeature(GenerationStage.Decoration.VEGETAL_DECORATION, PATCH_BLUEBERRY_BUSH);
        }
    }
}

Any help is appreciated.

Have some lorem ispum.

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.