Package net.minecraft.world.biome

Examples of net.minecraft.world.biome.BiomeGenBase


   * Populates chunk with ores etc etc
   */
  public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
    int k = par2 * 16;
    int l = par3 * 16;
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);
    boolean flag = false;
    this.random.setSeed(this.worldObj.getSeed());
    long i1 = this.random.nextLong() / 2L * 2L + 1L;
    long j1 = this.random.nextLong() / 2L * 2L + 1L;
    this.random.setSeed((long) par2 * i1 + (long) par3 * j1 ^ this.worldObj.getSeed());
View Full Code Here


  /**
   * Returns a list of creatures of the specified type that can spawn at the given location.
   */
  public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) {
    BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
    return biomegenbase == null ? null : biomegenbase.getSpawnableList(par1EnumCreatureType);
  }
View Full Code Here

  protected abstract boolean generateFeature(Random random, int chunkX, int chunkZ, World world);

  protected boolean canGenerateInBiome(World world, int x, int z, Random rand) {

    if (biomeRestriction != GenRestriction.NONE) {
      BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
      return !(biomeRestriction == GenRestriction.BLACKLIST == biomes.contains(biome, rand));
    }
    return true;
  }
View Full Code Here

  @Override
  public boolean contains(Object o) {
    BiomeInfo[] oldData = elementData;
    if (o instanceof BiomeGenBase) {
      BiomeGenBase bgb = (BiomeGenBase)o;
      for (int i = 0, e = size; i < e; ++i)
        if (oldData[i] != null && oldData[i].isBiomeEqual(bgb, null))
          return true;
      return false;
    }
View Full Code Here

      for (z = 0; z < width; ++z) {
        for (y = 0; y < height; ++y) {
          if (spawnBlock[(x * width + z) * height + y] &&
              world.getBlock(xStart + x, yStart + y - 1, zStart + z).equals(Blocks.dirt)
              && world.getSavedLightValue(EnumSkyBlock.Sky, xStart + x, yStart + y, zStart + z) > 0) {
            BiomeGenBase bgb = world.getBiomeGenForCoords(xStart + x, zStart + z);
            if (lineWithFiller)
              world.setBlock(xStart + x, yStart + y - 1, zStart + z, bgb.fillerBlock, 0, 2);
            else
              world.setBlock(xStart + x, yStart + y - 1, zStart + z, bgb.topBlock, bgb.field_150604_aj, 2);
          }
View Full Code Here

        for (int k1 = -1; k1 <= 1; ++k1)
        {
            for (int l1 = -1; l1 <= 1; ++l1)
            {
                BiomeGenBase biome = world.getBiomeGenForCoords(x + l1, z + k1);
                int grassColor = 0;
                if (meta == 1)
                {
                    double temp = MathHelper.clamp_float(biome.getFloatTemperature(x, y, z), 0.0F, 1.0F);
                    double rainfall = MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
                    grassColor = GrassColorizerAlternate.getBlueGrassColor(temp, rainfall);
                }
                else if (meta == 2)
                {
                    double temp = MathHelper.clamp_float(biome.getFloatTemperature(x, y, z), 0.0F, 1.0F);
                    double rainfall = MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
                    grassColor = GrassColorizerAlternate.getOrangeGrassColor(temp, rainfall);
                }
                else
                {
                    grassColor = biome.getBiomeGrassColor(x, y, z);
                }
                l += (grassColor & 16711680) >> 16;
                i1 += (grassColor & 65280) >> 8;
                j1 += grassColor & 255;
            }
View Full Code Here

        for (int k1 = -1; k1 <= 1; ++k1)
        {
            for (int l1 = -1; l1 <= 1; ++l1)
            {
                BiomeGenBase biome = world.getBiomeGenForCoords(x + l1, z + k1);
                int grassColor = 0;
                if (meta == 1)
                {
                    double temp = MathHelper.clamp_float(biome.getFloatTemperature(x, y, z), 0.0F, 1.0F);
                    double rainfall = MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
                    grassColor = GrassColorizerAlternate.getBlueGrassColor(temp, rainfall);
                }
                else if (meta == 2)
                {
                    double temp = MathHelper.clamp_float(biome.getFloatTemperature(x, y, z), 0.0F, 1.0F);
                    double rainfall = MathHelper.clamp_float(biome.getFloatRainfall(), 0.0F, 1.0F);
                    grassColor = GrassColorizerAlternate.getOrangeGrassColor(temp, rainfall);
                }
                else
                {
                    grassColor = biome.getBiomeGrassColor(x, y, z);
                }
                l += (grassColor & 16711680) >> 16;
                i1 += (grassColor & 65280) >> 8;
                j1 += grassColor & 255;
            }
View Full Code Here

        final int xChunk = chunkX * 16 + 8, zChunk = chunkZ * 16 + 8;
        int xCh = chunkX * 16 + random.nextInt(16);
        int yCh = random.nextInt(128);
        int zCh = chunkZ * 16 + random.nextInt(16);

        BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(chunkX * 16, chunkZ * 16);

        //Barley
        if (PHNatura.generateBarley && random.nextInt(5) == 0 && goodClimate(biome, 0.11f, 1.0f, 0.11f, 2f))
        {
            generateBarley(world, random, xCh, yCh + PHNatura.seaLevel, zCh);
View Full Code Here

        {
            return this.genNetherBridge.getSpawnList();
        }
        else
        {
            BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(par2, par4);
            return biomegenbase == null ? null : biomegenbase.getSpawnableList(par1EnumCreatureType);
        }
    }
View Full Code Here

  {
    MFRLiquidMover.pumpLiquid(_tank, this);
   
    if(worldObj.getWorldInfo().isRaining() && canSeeSky())
    {
      BiomeGenBase bgb = worldObj.getBiomeGenForCoords(this.xCoord, this.zCoord);
     
      if(!bgb.canSpawnLightningBolt() && !bgb.getEnableSnow())
      {
        setIdleTicks(getIdleTicksMax());
        return false;
      }
      setWorkDone(getWorkDone() + 1);
      if(getWorkDone() >= getWorkMax())
      {
        if(bgb.getFloatTemperature() >= 0.15F)
        {
          if(_tank.fill(new LiquidStack(Block.waterStill.blockID, LiquidContainerRegistry.BUCKET_VOLUME), true) > 0)
          {
            setWorkDone(0);
            return true;
View Full Code Here

TOP

Related Classes of net.minecraft.world.biome.BiomeGenBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.