Package org.spout.api.generator.biome

Examples of org.spout.api.generator.biome.Biome


  public boolean isRaining() {
    return this.getCurrent().isRaining();
  }

  public boolean isSnowingAt(int x, int y, int z) {
    Biome biome = getWorld().getBiome(x, y, z);
    if (biome instanceof VanillaBiome) {
      VanillaBiome vb = (VanillaBiome) biome;
      if (vb.getClimate().hasSnowfall()) {
        return getCurrent().isRaining() && y > getWorld().getSurfaceHeight(x, z);
      }
View Full Code Here


    return false;
  }

  public boolean isRainingAt(int x, int y, int z, boolean includeSnow) {
    if (!includeSnow) {
      Biome biome = getWorld().getBiome(x, y, z);
      if (biome instanceof VanillaBiome) {
        VanillaBiome vb = (VanillaBiome) biome;
        if (vb.getClimate().hasRainfall()) {
          return getCurrent().isRaining() && y > getWorld().getSurfaceHeight(x, z);
        }
View Full Code Here

      Chunk chunk = p.getWorld().getChunkFromBlock(p, LoadOption.LOAD_ONLY);
      byte[] biomeData = new byte[Chunk.BLOCKS.AREA];
      for (int dx = x; dx < x + Chunk.BLOCKS.SIZE; ++dx) {
        for (int dz = z; dz < z + Chunk.BLOCKS.SIZE; ++dz) {
          Biome biome = chunk.getBiome(dx & Chunk.BLOCKS.MASK, 0, dz & Chunk.BLOCKS.MASK);
          if (biome instanceof VanillaBiome) {
            biomeData[(dz & Chunk.BLOCKS.MASK) << 4 | (dx & Chunk.BLOCKS.MASK)] = (byte) ((VanillaBiome) biome).getBiomeId();
          }
        }
      }
View Full Code Here

    final int sizeX = size.getFloorX();
    final int sizeY = GenericMath.clamp(size.getFloorY(), 0, NormalGenerator.HEIGHT);
    final int sizeZ = size.getFloorZ();
    for (int xx = 0; xx < sizeX; xx++) {
      for (int zz = 0; zz < sizeZ; zz++) {
        final Biome biome = biomes.getBiome(xx, 0, zz);
        if (!(biome instanceof GroundCoverBiome)) {
          continue;
        }
        final GroundCoverLayer[] layers = ((GroundCoverBiome) biome).getGroundCover();
        int yy = sizeY - 1;
View Full Code Here

    Player player = (Player) source;
    if (!(player.getPhysics().getPosition().getWorld().getGenerator() instanceof BiomeGenerator)) {
      throw new CommandException("This map does not appear to have any biome data.");
    }
    Point pos = player.getPhysics().getPosition();
    Biome biome = pos.getWorld().getBiome(pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
    source.sendMessage(plugin.getPrefix() + ChatStyle.GREEN + "Current biome: " + ChatStyle.WHITE + (biome != null ? biome.getName() : "none"));
  }
View Full Code Here

          final Block block = world.getBlock(x + px, y + py, z + pz);
          if (block.isAtSurface()) {
            final BlockMaterial material = block.getMaterial();
            if (material == VanillaMaterials.DIRT) {
              final BlockMaterial top;
              final Biome biome = block.getBiomeType();
              if (biome instanceof GrassyBiome) {
                top = ((GrassyBiome) biome).getGroundCover()[0].getMaterial(true);
              } else {
                top = VanillaMaterials.GRASS;
              }
View Full Code Here

  public void populate(Chunk chunk, Random random) {
    if (chunk.getY() != 4) {
      return;
    }
    final World world = chunk.getWorld();
    final Biome decorating = chunk.getBiome(7, 7, 7);
    final byte amount = factory.amount(random);
    for (byte count = 0; count < amount; count++) {
      final TreeObject tree = factory.make(random);
      tree.setRandom(random);
      tree.randomize();
View Full Code Here

TOP

Related Classes of org.spout.api.generator.biome.Biome

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.