001 package net.minecraft.world.biome; 002 003 import cpw.mods.fml.relauncher.Side; 004 import cpw.mods.fml.relauncher.SideOnly; 005 import java.util.Random; 006 import net.minecraft.entity.monster.EntitySlime; 007 import net.minecraft.world.ColorizerFoliage; 008 import net.minecraft.world.ColorizerGrass; 009 import net.minecraft.world.gen.feature.WorldGenerator; 010 011 public class BiomeGenSwamp extends BiomeGenBase 012 { 013 protected BiomeGenSwamp(int par1) 014 { 015 super(par1); 016 this.theBiomeDecorator.treesPerChunk = 2; 017 this.theBiomeDecorator.flowersPerChunk = -999; 018 this.theBiomeDecorator.deadBushPerChunk = 1; 019 this.theBiomeDecorator.mushroomsPerChunk = 8; 020 this.theBiomeDecorator.reedsPerChunk = 10; 021 this.theBiomeDecorator.clayPerChunk = 1; 022 this.theBiomeDecorator.waterlilyPerChunk = 4; 023 this.waterColorMultiplier = 14745518; 024 this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); 025 } 026 027 /** 028 * Gets a WorldGen appropriate for this biome. 029 */ 030 public WorldGenerator getRandomWorldGenForTrees(Random par1Random) 031 { 032 return this.worldGeneratorSwamp; 033 } 034 035 @SideOnly(Side.CLIENT) 036 037 /** 038 * Provides the basic grass color based on the biome temperature and rainfall 039 */ 040 public int getBiomeGrassColor() 041 { 042 double var1 = (double)this.getFloatTemperature(); 043 double var3 = (double)this.getFloatRainfall(); 044 return ((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2; 045 } 046 047 @SideOnly(Side.CLIENT) 048 049 /** 050 * Provides the basic foliage color based on the biome temperature and rainfall 051 */ 052 public int getBiomeFoliageColor() 053 { 054 double var1 = (double)this.getFloatTemperature(); 055 double var3 = (double)this.getFloatRainfall(); 056 return ((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2; 057 } 058 }