Dimensions and Custom Biomes

Started by AnthemGS on

Topic category: Help with MCreator software

Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dimensions and Custom Biomes
Wed, 11/22/2017 - 08:16 (edited)

Hello, I'm trying to make my own dimension, with its own specific biomes. The terrain generation works perfectly fine, but no mobs, grass, flowers or trees are spawning. 

Also, the certain biomes are spawning in the overworld, where I only want them to spawn in the custom dimension.

Any tips greatly appreciated.

 


Code:

Biome One:

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeDictionary;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityHorse;

import java.util.Random;

public class mcreator_alfheimPlains {

    static Biome.BiomeProperties customProps = null;
    public static BiomeGenalfheimPlains biome = null;

    static {
        customProps = new Biome.BiomeProperties("alfheimPlains");
        customProps.setRainfall(0.5F);
        customProps.setBaseHeight(0.1F);
        customProps.setHeightVariation(0.2F);
        customProps.setWaterColor(0xaec8eb);
        biome = new BiomeGenalfheimPlains(customProps);
    }

    public static Object instance;

    public mcreator_alfheimPlains() {
    }

    public void load(FMLInitializationEvent event) {
        ForgeRegistries.BIOMES.register(biome);
        BiomeDictionary.addTypes(biome, BiomeDictionary.Type.FOREST);
        BiomeManager.addSpawnBiome(biome);
        BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(biome, 10));
    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public void registerRenderers() {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    static class BiomeGenalfheimPlains extends Biome {
        @SuppressWarnings("unchecked")
        public BiomeGenalfheimPlains(Biome.BiomeProperties mycustomProps) {
            super(mycustomProps);
            setRegistryName("alfheimPlains");
            topBlock = mcreator_alfGrass.block.getDefaultState();
            fillerBlock = mcreator_alfDirt.block.getDefaultState();
            decorator.generateFalls = true;
            decorator.treesPerChunk = 0;
            decorator.flowersPerChunk = 20;
            decorator.grassPerChunk = 20;
            decorator.deadBushPerChunk = 0;
            decorator.mushroomsPerChunk = 0;
            decorator.reedsPerChunk = 0;
            decorator.cactiPerChunk = 0;
            decorator.sandPatchesPerChunk = 0;

            this.spawnableMonsterList.clear();
            this.spawnableCreatureList.clear();
            this.spawnableWaterCreatureList.clear();
            this.spawnableCaveCreatureList.clear();
            this.spawnableMonsterList.add(new SpawnListEntry(EntityRabbit.class, 5, 1, 5));
            this.spawnableMonsterList.add(new SpawnListEntry(EntityPig.class, 5, 1, 5));
            this.spawnableMonsterList.add(new SpawnListEntry(EntityHorse.class, 5, 1, 5));

        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getGrassColorAtPos(BlockPos pos) {
            return 0xa4f8d4;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getFoliageColorAtPos(BlockPos pos) {
            return 0xa4f8d4;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getSkyColorByTemp(float currentTemperature) {
            return 0xefdb92;
        }

    }

}
 

Biome 2:

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeDictionary;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityRabbit;

import java.util.Random;

public class mcreator_alfheimHills {

    static Biome.BiomeProperties customProps = null;
    public static BiomeGenalfheimHills biome = null;

    static {
        customProps = new Biome.BiomeProperties("alfheimHills");
        customProps.setRainfall(0.5F);
        customProps.setBaseHeight(0.1F);
        customProps.setHeightVariation(0.3F);
        customProps.setWaterColor(0x80c1e6);
        biome = new BiomeGenalfheimHills(customProps);
    }

    public static Object instance;

    public mcreator_alfheimHills() {
    }

    public void load(FMLInitializationEvent event) {
        ForgeRegistries.BIOMES.register(biome);
        BiomeDictionary.addTypes(biome, BiomeDictionary.Type.FOREST);
        BiomeManager.addSpawnBiome(biome);
        BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(biome, 10));
    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public void registerRenderers() {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    static class BiomeGenalfheimHills extends Biome {
        @SuppressWarnings("unchecked")
        public BiomeGenalfheimHills(Biome.BiomeProperties mycustomProps) {
            super(mycustomProps);
            setRegistryName("alfheimHills");
            topBlock = mcreator_alfGrass.block.getDefaultState();
            fillerBlock = mcreator_alfDirt.block.getDefaultState();
            decorator.generateFalls = false;
            decorator.treesPerChunk = 5;
            decorator.flowersPerChunk = 20;
            decorator.grassPerChunk = 20;
            decorator.deadBushPerChunk = 0;
            decorator.mushroomsPerChunk = 0;
            decorator.reedsPerChunk = 0;
            decorator.cactiPerChunk = 0;
            decorator.sandPatchesPerChunk = 0;

            this.spawnableMonsterList.clear();
            this.spawnableCreatureList.clear();
            this.spawnableWaterCreatureList.clear();
            this.spawnableCaveCreatureList.clear();
            this.spawnableMonsterList.add(new SpawnListEntry(EntityRabbit.class, 5, 1, 5));
            this.spawnableMonsterList.add(new SpawnListEntry(EntitySheep.class, 5, 1, 5));

        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getGrassColorAtPos(BlockPos pos) {
            return 0xa1f5e1;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getFoliageColorAtPos(BlockPos pos) {
            return 0xa1f5e1;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getSkyColorByTemp(float currentTemperature) {
            return 0xe7d763;
        }

    }

}
 

Biome 3:

import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.common.BiomeDictionary;

import net.minecraft.world.biome.Biome;
import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.passive.EntityWolf;

import java.util.Random;

public class mcreator_alfheimForest {

    static Biome.BiomeProperties customProps = null;
    public static BiomeGenalfheimForest biome = null;

    static {
        customProps = new Biome.BiomeProperties("alfheimForest");
        customProps.setRainfall(0.5F);
        customProps.setBaseHeight(0.1F);
        customProps.setHeightVariation(0.2F);
        customProps.setWaterColor(0x7dd1ec);
        biome = new BiomeGenalfheimForest(customProps);
    }

    public static Object instance;

    public mcreator_alfheimForest() {
    }

    public void load(FMLInitializationEvent event) {
        ForgeRegistries.BIOMES.register(biome);
        BiomeDictionary.addTypes(biome, BiomeDictionary.Type.FOREST);
        BiomeManager.addSpawnBiome(biome);
        BiomeManager.addBiome(BiomeManager.BiomeType.WARM, new BiomeManager.BiomeEntry(biome, 10));
    }

    public void generateNether(World world, Random random, int chunkX, int chunkZ) {
    }

    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
    }

    public void registerRenderers() {
    }

    public int addFuel(ItemStack fuel) {
        return 0;
    }

    public void serverLoad(FMLServerStartingEvent event) {
    }

    public void preInit(FMLPreInitializationEvent event) {
    }

    static class BiomeGenalfheimForest extends Biome {
        @SuppressWarnings("unchecked")
        public BiomeGenalfheimForest(Biome.BiomeProperties mycustomProps) {
            super(mycustomProps);
            setRegistryName("alfheimForest");
            topBlock = mcreator_alfGrass.block.getDefaultState();
            fillerBlock = mcreator_alfDirt.block.getDefaultState();
            decorator.generateFalls = false;
            decorator.treesPerChunk = 15;
            decorator.flowersPerChunk = 20;
            decorator.grassPerChunk = 20;
            decorator.deadBushPerChunk = 0;
            decorator.mushroomsPerChunk = 0;
            decorator.reedsPerChunk = 0;
            decorator.cactiPerChunk = 0;
            decorator.sandPatchesPerChunk = 0;

            this.spawnableMonsterList.clear();
            this.spawnableCreatureList.clear();
            this.spawnableWaterCreatureList.clear();
            this.spawnableCaveCreatureList.clear();
            this.spawnableMonsterList.add(new SpawnListEntry(EntityWolf.class, 5, 1, 5));

        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getGrassColorAtPos(BlockPos pos) {
            return 0x8af8d0;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getFoliageColorAtPos(BlockPos pos) {
            return 0x8af8d0;
        }

        @SideOnly(Side.CLIENT)
        @Override
        public int getSkyColorByTemp(float currentTemperature) {
            return 0xeede6e;
        }

    }

}
 

Edited by AnthemGS on Wed, 11/22/2017 - 08:16
Joined Mar 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Full disclosure; I Have No…
Fri, 12/15/2017 - 00:11

Full disclosure; I Have No Idea if this will work

Maybe try changing the second world in this line of code:

import net.minecraft.world.World;

to the Id of your dimension (which you can find in gradel)

Joined Nov 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For the issue of getting…
Fri, 12/15/2017 - 22:56

For the issue of getting your biomes OUT of the overworld, set biome weights to 0 in the biome creation menu. This will make it so that your custom biomes will only be in your custom dimension.