Package net.minecraft.world.biome

Examples of net.minecraft.world.biome.BiomeGenBase


    return Math.round(i * humidity);
  }

  public void updateBiome() {
    if (worldObj != null) {
      BiomeGenBase biome = Utils.getBiomeAt(worldObj, xCoord, zCoord);
      if (biome != null) {
        this.biomeId = biome.biomeID;
        this.temperature = biome.temperature;
        this.humidity = biome.rainfall;
        setErrorState(EnumErrorCode.OK);
View Full Code Here


        int worldZ = event.worldZ;

        if (!TerrainGen.generateOre(world, rand, sulfur, worldX, worldZ, EVENT_TYPE))
            return;

        BiomeGenBase biome = world.getBiomeGenForCoords(worldX + 16, worldZ + 16);
        if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MOUNTAIN))
            for (int i = 0; i < 90; i++) {
                int x = worldX + rand.nextInt(16);
                int y = 6 + rand.nextInt(10);
                int z = worldZ + rand.nextInt(16);
View Full Code Here

            geode.generate(world, rand, x, y, z);
        }
    }

    private boolean canGen(World world, Random rand, int x, int z) {
        BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
        if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.WATER)) {
            return false;
        }
        if (biome.biomeName == null || biome.biomeName.toLowerCase(Locale.ENGLISH).contains("river")) {
            return false;
View Full Code Here

        int worldZ = event.chunkZ;

        if (!TerrainGen.decorate(world, rand, worldX, worldZ, EVENT_TYPE))
            return;

        BiomeGenBase biome = world.getBiomeGenForCoords(worldX + 16, worldZ + 16);
        if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER) && rand.nextDouble() <= 0.1) {
            int x = worldX + rand.nextInt(16);
            int y = 31;
            int z = worldZ + rand.nextInt(16);
View Full Code Here

                saltpeter.generate(world, rand, x, y, z);
            }
    }

    private boolean canGen(World world, Random rand, int x, int z) {
        BiomeGenBase biome = world.getBiomeGenForCoords(x + 16, z + 16);
        if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.DESERT))
            return false;
        if (biome.canSpawnLightningBolt())
            return false;
        return biome.temperature >= 1.5f && biome.rainfall <= 0.1f;
    }
View Full Code Here

            }
        }
    }

    private boolean canGen(World world, Random rand, int x, int z) {
        BiomeGenBase biome = world.getBiomeGenForCoords(x, z);
        if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FOREST)) {
            return false;
        }
        if (BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.FROZEN)) {
            return false;
View Full Code Here

        if (Game.isHost(getWorld())) {
            if (isMaster()) {
                if (worldObj.provider.dimensionId != -1 && clock % REFILL_INTERVAL == 0) {
                    float rate = REFILL_RATE;
                    BiomeGenBase biome = worldObj.getBiomeGenForCoords(xCoord, zCoord);
                    float humidity = biome.rainfall;
                    rate *= humidity;
//                    String debug = "Biome=" + biome.biomeName + ", Humidity=" + humidity;

                    boolean outside = false;
                    for (int x = xCoord - 1; x <= xCoord + 1; x++) {
                        for (int z = zCoord - 1; z <= zCoord + 1; z++) {
                            outside = worldObj.canBlockSeeTheSky(x, yCoord + 3, z);
//                            System.out.println(x + ", " + (yCoord + 3) + ", " + z);
                            if (outside)
                                break;
                        }
                    }

//                    debug += ", Outside=" + outside;
                    if (!outside)
                        rate *= REFILL_PENALTY_INSIDE;
                    else if (worldObj.isRaining())
                        if (biome.getEnableSnow())
                            rate *= REFILL_PENALTY_SNOW; //                            debug += ", Snow=true";
                        else
                            rate *= REFILL_BOOST_RAIN; //                            debug += ", Rain=true";
                    int rateFinal = MathHelper.floor_float(rate);
                    if (rateFinal < REFILL_RATE_MIN)
View Full Code Here

  {
    final String base = "Override biome detection: ";
    // biomeList
    if (this.definedBiomeID >= 0 && this.definedBiomeID < BiomeGenBase.getBiomeGenArray().length)
    {
      BiomeGenBase biome = BiomeGenBase.getBiomeGenArray()[this.definedBiomeID];
      if (biome == null)
        return base + "Undefined biome (" + this.definedBiomeID + ")";
      else if (biome.biomeName.equals(""))
        return base + "Unnamed biome (" + this.definedBiomeID + ")";
      else
View Full Code Here

        // Trigger just before sand pass one--which comes just after vanilla ore
        // generation.
        if (e.type != SAND)
            return;

        BiomeGenBase biome = e.world.getWorldChunkManager().getBiomeGenAt(e.chunkX, e.chunkZ);
        int iterations = EXTRA_ORE_BIOMES.contains(biome) ? 2 : 1;
        for (int i = 0; i < iterations; i++)
        {
            generateSurfaceOres(e.rand, e.chunkX, e.chunkZ, e.world);
        }
View Full Code Here

        // Trigger just before sand pass one--which comes just after vanilla ore
        // generation.
        if (e.type != SAND)
            return;

        BiomeGenBase biome = e.world.getWorldChunkManager().getBiomeGenAt(e.chunkX, e.chunkZ);
        int iterations = EXTRA_ORE_BIOMES.contains(biome) ? 2 : 1;
        for (int i = 0; i < iterations; i++)
        {
            generateSurfaceOres(e.rand, e.chunkX, e.chunkZ, e.world);
        }
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.