Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hi, I have a new problem about my mod, i have created a custom feature (Tree Generation) and when i try to put this in my biome (with feature); the trees don't generate. I join my biome class and my

class where there is the configured feature.

public enum InitConfiguredFeatures
    {
        DEPTHWOOD((IObject<String, ConfiguredFeature<BaseTreeFeatureConfig,?>>)
                () -> new Tuple<>("depthwood", Feature.TREE.withConfiguration((
                        new BaseTreeFeatureConfig.Builder(
                                new SimpleBlockStateProvider(InitBlocks.DEEP_LOG.getObj().getB().getDefaultState()),
                                new SimpleBlockStateProvider(InitBlocks.DEEP_LEAVES.getObj().getB().getDefaultState()),
                                new BlobFoliagePlacer(FeatureSpread.create(2), FeatureSpread.create(0), 3),
                                new StraightTrunkPlacer(6, 4, 3),
                                new TwoLayerFeature(1, 0, 1))).setIgnoreVines().build())));

        private final Tuple<String, ? extends ConfiguredFeature<?, ?>> obj;

        <T extends ConfiguredFeature<?, ?>> InitConfiguredFeatures(IObject<String, T> object)
        {
            this.obj = object.object();
        }

        public Tuple<String, ? extends  ConfiguredFeature<?, ?>> getObj()
        {
            return obj;
        }

        public static void register(IEventBus eventBus)
        {
            for (InitConfiguredFeatures configuredFeature : values())
            {
                Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, configuredFeature.getObj().getA(),
                        configuredFeature.getObj().getB());
            }
        }
public static void registerElements(IEventBus eventBus)
    {
        InitItems.register(eventBus);
        InitBlocks.register(eventBus);
        InitArmors.register(eventBus);
        InitBiomes.register(eventBus);
        InitTileEntities.register(eventBus);
        InitContainers.register(eventBus);
        InitRecipes.register(eventBus);
        InitConfiguredFeatures.register(eventBus);
    }
public class BioDomeBiome extends BiomeCore
{
    public BioDomeBiome()
    {
        super(() -> ModSurfaceBuilders.BIODOME_SURFACE, 0.110f, 0.01f,
                (surfaceBuilder, depth, scale) ->
        {
            MobSpawnInfo.Builder mobspawninfo$builder = new MobSpawnInfo.Builder();

            BiomeGenerationSettings.Builder biomegenerationsettings$builder =
                    (new BiomeGenerationSettings.Builder()).withSurfaceBuilder(surfaceBuilder);

            biomegenerationsettings$builder.withFeature(GenerationStage.Decoration.LAKES, Features.LAKE_WATER);
            biomegenerationsettings$builder.withFeature(GenerationStage.Decoration.VEGETAL_DECORATION,
                    InitElements.InitConfiguredFeatures.DEPTHWOOD.getObj().getB());

            return (new Biome.Builder())
                    .precipitation(Biome.RainType.NONE)
                    .category(Biome.Category.PLAINS)
                    .depth(depth)
                    .scale(scale)
                    .temperature(1.5F)
                    .downfall(0.9f)
                    .setEffects((new BiomeAmbience.Builder())
                            .setWaterColor(9089394).setWaterFogColor(7915881)
                            .setFogColor(7915881).withSkyColor(1457975)
                            .setAmbientSound
                                    (SoundEvents.AMBIENT_CRIMSON_FOREST_LOOP)
                            .setMoodSound(new MoodSoundAmbience
                                    (SoundEvents.AMBIENT_WARPED_FOREST_MOOD, 6000, 8, 2.0D))
                            .setAdditionsSound(new SoundAdditionsAmbience
                                    (SoundEvents.AMBIENT_NETHER_WASTES_ADDITIONS, 0.0111D))
                            .setMusic(BackgroundMusicTracks.getDefaultBackgroundMusicSelector
                                    (SoundEvents.MUSIC_NETHER_CRIMSON_FOREST))
                            .build()).withMobSpawnSettings(mobspawninfo$builder.build())
                    .withGenerationSettings(biomegenerationsettings$builder.build()).build();
        });
    }
}
public enum InitBiomes
    {
        BIO_DOME((IObject<String, Biome>) () -> new Tuple<>
                ("biodome_biome",  new BioDomeBiome().getBiome())),
        MOSS_RIVER((IObject<String, Biome>) () -> new Tuple<>
                ("mossriver_biome", new MossRiverBiome().getBiome()));

        private final Tuple<String, ? extends Biome> obj;

        <T extends Biome> InitBiomes(IObject<String, T> object)
        {
            this.obj = object.object();
        }

        public Tuple<String, ? extends Biome> getObj()
        {
            return obj;
        }

        public static void register(IEventBus eventBus)
        {
            ObjectRegister<Biome> registerBiomes = new ObjectRegister<>(ForgeRegistries.BIOMES);
            for (InitBiomes biome : values())
            {
                registerBiomes.addElement(biome.getObj().getA(), biome.getObj().getB());
            }
            registerBiomes.register(eventBus);
        }
    }

 

Edited by Olegueyan

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.