Jump to content

How to create a single biomed world type.


FrenziedMurder

Recommended Posts

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.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I create my mod pack,yesterday my mod pack is fine but i add one mod and error. I'm delete this mmod but minecraft is still stop on CONFIG_LOAD then I tried to delete config and restart it but again. If you can pleace help me. https://imgur.com/ngZBzuv
    • game crashes before even opening (log:https://mclo.gs/M8xvX7c)
    • I have created a custom entity that extends "TamableAnimal", but I am wanting to have it spawn in the ocean. I have it spawning right now, but it spawns way too frequently even with weight set to 1. I am guessing it is because it is rolling in the spawn pool of land animals since TameableAnimal extends Animal and is different than WaterAnimal, and since no land animals spawn in the ocean it just fills every inch up with my custom entity. I have followed basic tutorials for spawning entities with Forge, but I feel like I am missing something about how to change what spawn pool this custom entity ends up in. Is it possible to change that or do I need to refactor it to be based off of WaterAnimal to get those spawn? My biome modifier JSON file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_ocean", "spawners": { "type": "darwinsmysticalmounts:water_animal", "weight": 20, "minCount": 1, "maxCount": 1 } } My client event: event.register(ModEntityTypes.WATER_ANIMAL.get(), SpawnPlacements.Type.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaterWyvernEntity::checkCustomWaterAnimalSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); And the actual custom spawn rule that makes it spawn in the water: public static boolean checkCustomWaterAnimalSpawnRules(EntityType<WaterAnimalEntity> pAnimal, LevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pPos.getY() > pLevel.getSeaLevel() - 16 && pLevel.getFluidState(pPos.below()).is(FluidTags.WATER); }  
    • Starting today, I am unable to load my modded minecraft world. Forge crash log initially said it was a specific mod called Doggy Talents, which I disabled. Then it blamed JEI, and when that was disabled it blamed another mod so I assume it's something more than a specific mod. Minecraft launcher log claims "Exit Code 1". Nothing had changed since last night when it was working fine Forge Log: https://pastebin.com/S1GiBGVJ Client Log: https://pastebin.com/aLwuGUNL  
    • I am using AMD, yes. I downloaded the website's drivers and am still having the issue. I also used the Cleanup Utility just in case. 
  • Topics

×
×
  • Create New...

Important Information

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