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

Ok so.  My mod ive made a new World Type and im trying to make it ONLY generator my biome but everytime i run it it loads My biome, roofed forest rivers and oceans.  My goal is to make a custom river biome that instead of water is lava, and a custom ocean that is lava as well but get rid of the roofed forest.  If anyone can help me thatd be appreciated.

 

BiomeGenMYMOD

 

package net.MYMOD.biomes;

 

import net.minecraft.entity.monster.EntitySlime;

import net.minecraft.init.Blocks;

import net.minecraft.world.biome.BiomeGenBase;

 

public class BiomeGenMYMOD extends BiomeGenBase

{

 

public BiomeGenMYMOD(int id){

super(id);

this.topBlock = Blocks.diamond_block;

this.fillerBlock = Blocks.gold_block;

 

}

 

}

 

The diamond block was just to find it easier

BiomeRegister

 

package net.MYMOD.biomes;

 

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraftforge.common.BiomeDictionary;

import net.minecraftforge.common.BiomeDictionary.Type;

import net.minecraftforge.common.BiomeManager;

 

public class BiomeRegistry

{

 

public static void MYMOD()

{

initializeBiome();

registerBiome();

}

 

public static BiomeGenBase MYMOD;

 

public static void initializeBiome()

{

 

MYMOD = new BiomeGenMYMOD(137).setBiomeName("MYMOD");

 

}

 

public static void registerBiome(){

BiomeDictionary.registerBiomeType(MYMOD, Type.FOREST);

BiomeManager.addSpawnBiome(MYMOD);

 

}

 

}

 

MYMODGenLayerBiome

 

package net.MYMOD.biomes;

 

import java.util.ArrayList;

import java.util.List;

 

import net.minecraft.util.WeightedRandom;

import net.minecraft.world.WorldType;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.gen.layer.GenLayer;

import net.minecraft.world.gen.layer.IntCache;

import net.minecraftforge.common.BiomeManager;

import net.minecraftforge.common.BiomeManager.BiomeEntry;

 

public class MYMODGenLayerBiome extends GenLayer

{

    private List<BiomeEntry> desertBiomes = new ArrayList<BiomeEntry>();

    private List<BiomeEntry> warmBiomes = new ArrayList<BiomeEntry>();

    private List<BiomeEntry> coolBiomes = new ArrayList<BiomeEntry>();

    private List<BiomeEntry> icyBiomes = new ArrayList<BiomeEntry>();

   

    private static final String __OBFID = "CL_00000555";

 

    public MYMODGenLayerBiome(long p_i2122_1_, GenLayer p_i2122_3_, WorldType p_i2122_4_)

    {

        super(p_i2122_1_);

       

        this.parent = p_i2122_3_;

       

        this.desertBiomes.addAll(BiomeManager.desertBiomes);

        this.warmBiomes.addAll(BiomeManager.warmBiomes);

        this.coolBiomes.addAll(BiomeManager.coolBiomes);

        this.icyBiomes.addAll(BiomeManager.icyBiomes);

       

        if (p_i2122_4_ == WorldType.DEFAULT_1_1)

        {

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.desert, 10));

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.forest, 10));

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.extremeHills, 10));

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.swampland, 10));

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.plains, 10));

            //desertBiomes.add(new BiomeEntry(BiomeGenBase.taiga, 10));

            desertBiomes.add(new BiomeEntry(BiomeRegistry.MYMOD, 10));

        }

        else

        {

          //desertBiomes.add(new BiomeEntry(BiomeGenBase.desert, 30));

          //desertBiomes.add(new BiomeEntry(BiomeGenBase.savanna, 20));

          //desertBiomes.add(new BiomeEntry(BiomeGenBase.plains, 10));

        desertBiomes.add(new BiomeEntry(BiomeRegistry.MYMOD, 10));

        }

    }

 

    /**

    * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall

    * amounts, or biomeList[] indices based on the particular GenLayer subclass.

    */

    public int[] getInts(int p_75904_1_, int p_75904_2_, int p_75904_3_, int p_75904_4_)

    {

        int[] aint = this.parent.getInts(p_75904_1_, p_75904_2_, p_75904_3_, p_75904_4_);

        int[] aint1 = IntCache.getIntCache(p_75904_3_ * p_75904_4_);

 

        for (int i1 = 0; i1 < p_75904_4_; ++i1)

        {

            for (int j1 = 0; j1 < p_75904_3_; ++j1)

            {

                this.initChunkSeed((long)(j1 + p_75904_1_), (long)(i1 + p_75904_2_));

                int k1 = aint[j1 + i1 * p_75904_3_];

                int l1 = (k1 & 3840) >> 8;

                k1 &= -3841;

 

                if (isBiomeOceanic(BiomeRegistry.MYMOD.biomeID))

                {

                    aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                }

                else if (k1 == BiomeRegistry.MYMOD.biomeID)

                {

                    aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                }

                else if (k1 == 1)

                {

                    if (l1 > 0)

                    {

                        if (this.nextInt(3) == 0)

                        {

                            aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                        }

                        else

                        {

                            aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                        }

                    }

                    else

                    {

                        aint1[j1 + i1 * p_75904_3_] = ((BiomeEntry)WeightedRandom.getItem(this.desertBiomes, (int)(this.nextLong(WeightedRandom.getTotalWeight(this.desertBiomes) / 10) * 10))).biome.biomeID;

                    }

                }

                else if (k1 == 2)

                {

                    if (l1 > 0)

                    {

                        aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                    }

                    else

                    {

                        aint1[j1 + i1 * p_75904_3_] = ((BiomeEntry)WeightedRandom.getItem(this.warmBiomes, (int)(this.nextLong(WeightedRandom.getTotalWeight(this.warmBiomes) / 10) * 10))).biome.biomeID;

                    }

                }

                else if (k1 == 3)

                {

                    if (l1 > 0)

                    {

                        aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                    }

                    else

                    {

                        aint1[j1 + i1 * p_75904_3_] = ((BiomeEntry)WeightedRandom.getItem(this.coolBiomes, (int)(this.nextLong(WeightedRandom.getTotalWeight(this.coolBiomes) / 10) * 10))).biome.biomeID;

                    }

                }

                else if (k1 == 4)

                {

                    aint1[j1 + i1 * p_75904_3_] = ((BiomeEntry)WeightedRandom.getItem(this.icyBiomes, (int)(this.nextLong(WeightedRandom.getTotalWeight(this.icyBiomes) / 10) * 10))).biome.biomeID;

                }

                else

                {

                    aint1[j1 + i1 * p_75904_3_] = BiomeRegistry.MYMOD.biomeID;

                }

            }

        }

 

        return aint1;

    }

}

 

WorldTypeMYMOD

 

package net.MYMOD.biomes;

 

import net.minecraft.world.WorldType;

import net.minecraft.world.gen.layer.GenLayer;

import net.minecraft.world.gen.layer.GenLayerBiome;

import net.minecraft.world.gen.layer.GenLayerBiomeEdge;

import net.minecraft.world.gen.layer.GenLayerZoom;

 

public class WorldTypeMYMOD extends WorldType

{

 

public WorldTypeMYMOD(int par1, String name)

{

super(name);

}

 

 

public GenLayer getBiomeLayer(long worldSeed, GenLayer parentLayer)

    {

        GenLayer ret = new MYMODGenLayerBiome(200L, parentLayer, this);

        ret = GenLayerZoom.magnify(1000L, ret, 2);

        ret = new GenLayerBiomeEdge(1000L, ret);

        return ret;

    }

 

}

 

MYMOD(MainFile)

 

 

package net.MYMOD.mod;

 

import net.MYMOD.biomes.BiomeRegistry;

import net.MYMOD.biomes.WorldTypeMYMOD;

import net.minecraft.block.Block;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.world.WorldType;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraftforge.common.MinecraftForge;

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.event.FMLPostInitializationEvent;

import cpw.mods.fml.common.event.FMLPreInitializationEvent;

import cpw.mods.fml.common.registry.EntityRegistry;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

@Mod(modid = MYMOD.modid, version = MYMOD.version)

public class MYMOD

{

    public static final String modid = "MYMOD";

    public static final String version = "Alpha v0.1";

 

   

    @EventHandler

    public void preinit(FMLPreInitializationEvent event)

    {

    //Items

    //Register Items

        //Register Biomes

        BiomeRegistry.MYMOD();

        //Remove Biomes

       

    }

    @EventHandler

    public void PostLoad(FMLPostInitializationEvent PostEvent)

    {

    WorldType MYMOD = new WorldTypeMYMOD(15, "MYMOD");

    }

}

 

 

I havent made the River or Ocean Biome Gen because i dont know how to go about doing that and making it lava instead of water.

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.