Advertisement
WitherDoggie

NewModBiome

May 27th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.44 KB | None | 0 0
  1. package com.wither.withermod.worldgen.biome;
  2.  
  3. import java.util.Random;
  4.  
  5. import net.minecraft.block.BlockSand;
  6. import net.minecraft.block.material.Material;
  7. import net.minecraft.block.state.IBlockState;
  8. import net.minecraft.entity.EnumCreatureType;
  9. import net.minecraft.entity.monster.EntitySkeleton;
  10. import net.minecraft.init.Blocks;
  11. import net.minecraft.util.BlockPos;
  12. import net.minecraft.world.World;
  13. import net.minecraft.world.biome.BiomeGenBase;
  14. import net.minecraft.world.chunk.ChunkPrimer;
  15. import net.minecraftforge.fml.common.registry.EntityRegistry;
  16.  
  17. public class ModBiome extends BiomeGenBase {
  18.  
  19.     public ModBiome(int id) {
  20.         super(id);
  21.  
  22.         this.spawnableCreatureList.clear();
  23.         this.spawnableMonsterList.clear();
  24.         EntityRegistry.addSpawn(EntitySkeleton.class, 50, 1, 10, EnumCreatureType.MONSTER, this);
  25.  
  26.     }
  27.    
  28.     @Override
  29.     public void genTerrainBlocks(World worldIn, Random random, ChunkPrimer chunkPrimer, int x, int z, double stoneNoise) {
  30.         super.genTerrainBlocks(worldIn, random, chunkPrimer, x, z, stoneNoise);
  31.     }
  32.  
  33.  
  34.     public ModBiome setTopFillerBlock(IBlockState topBlock, IBlockState fillerBlock) {
  35.  
  36.         this.topBlock = topBlock;
  37.         this.fillerBlock = fillerBlock;
  38.  
  39.         return this;
  40.     }
  41.  
  42.     public ModBiome setMinMaxHeight(float minHeight, float maxHeight) {
  43.  
  44.         this.minHeight = minHeight;
  45.         this.maxHeight = maxHeight;
  46.  
  47.         return this;
  48.     }
  49.  
  50.    
  51.  
  52.     public ModBiome addDecoration(EnumBiomeDecorator decorator, int amount) {
  53.  
  54.         switch (decorator) {
  55.  
  56.         case BIGMUSHROOM:
  57.             this.theBiomeDecorator.bigMushroomsPerChunk = amount;
  58.  
  59.         case CACTI:
  60.             this.theBiomeDecorator.cactiPerChunk = amount;
  61.  
  62.         case CLAY:
  63.             this.theBiomeDecorator.clayPerChunk = amount;
  64.  
  65.         case DEADBUSH:
  66.             this.theBiomeDecorator.deadBushPerChunk = amount;
  67.  
  68.         case FLOWERS:
  69.             this.theBiomeDecorator.flowersPerChunk = amount;
  70.  
  71.         case GRASS:
  72.             this.theBiomeDecorator.grassPerChunk = amount;
  73.  
  74.         case MUSHROOMS:
  75.             this.theBiomeDecorator.mushroomsPerChunk = amount;
  76.  
  77.         case REEDS:
  78.             this.theBiomeDecorator.reedsPerChunk = amount;
  79.  
  80.         case SAND:
  81.             this.theBiomeDecorator.sandPerChunk = amount;
  82.  
  83.         case TREE:
  84.             this.theBiomeDecorator.treesPerChunk = amount;
  85.  
  86.         case WATERLILY:
  87.             this.theBiomeDecorator.waterlilyPerChunk = amount;
  88.  
  89.             break;
  90.         default:
  91.             break;
  92.         }
  93.         return this;
  94.  
  95.     }
  96.  
  97.     public static enum EnumBiomeDecorator {
  98.  
  99.         BIGMUSHROOM, CACTI, CLAY, DEADBUSH, FLOWERS, GRASS, MUSHROOMS, REEDS, SAND, TREE, WATERLILY;
  100.     }
  101.  
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement