Package org.bukkit.block

Examples of org.bukkit.block.Biome


    public void playerMoveEvent(PlayerMoveEvent event) {

        if (event.getFrom().getBlock().equals(event.getTo().getBlock())) return;

        // Compare the two biomes
        Biome from = event.getFrom().getWorld().getBiome(event.getFrom().getBlockX(), event.getFrom().getBlockZ());
        Biome to = event.getTo().getWorld().getBiome(event.getTo().getBlockX(), event.getTo().getBlockZ());
        if (!from.equals(to)) {

            // Create contexts
            Map<String, dObject> context = new HashMap<String, dObject>();
            context.put("from", new dLocation(event.getFrom()));
            context.put("to", new dLocation(event.getFrom()));
            context.put("old_biome", new Element(from.name()));
            context.put("new_biome", new Element(to.name()));

            String determination = EventManager.doEvents(Arrays.asList(
                    "player enters biome", "player exits biome",
                    "player enters " + to.name(), "player exits " + from.name()
                ), null, new dPlayer(event.getPlayer()), context, true);

            if (determination.toUpperCase().startsWith("CANCELLED"))
                event.setCancelled(true);
        }
View Full Code Here


    @Override
    public boolean setBiome(Vector2D position, BaseBiome biome) {
        BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
        if (adapter != null) {
            Biome bukkitBiome = adapter.getBiome(biome.getId());
            getWorld().setBiome(position.getBlockX(), position.getBlockZ(), bukkitBiome);
            return true;
        } else {
            return false;
        }
View Full Code Here

    @Nullable
    @Override
    public BiomeData getData(BaseBiome biome) {
        BukkitImplAdapter adapter = WorldEditPlugin.getInstance().getBukkitImplAdapter();
        if (adapter != null) {
            final Biome bukkitBiome = adapter.getBiome(biome.getId());
            return new BiomeData() {
                @Override
                public String getName() {
                    return bukkitBiome.name();
                }
            };
        } else {
            return null;
        }
View Full Code Here

        int sourceZ = (source.getZ() << 4) + random.nextInt(16);
        int sourceY = random.nextInt(world.getHighestBlockYAt(sourceX, sourceZ+ 32);

        // the flower can change on each decoration pass
        Flower flower = null;
        final Biome biome = world.getBiome(sourceX, sourceZ);
        if (biomesFlowers.containsKey(biome)) {
            flower = getRandomFlower(random, biomesFlowers.get(biome));
        } else {
            flower = getRandomFlower(random, defaultFlowers);
        }
View Full Code Here

            sourceY--;
        }

        // the grass species can change on each decoration pass
        GrassSpecies species = GrassSpecies.NORMAL;
        final Biome biome = world.getBiome(sourceX, sourceZ);
        if (biomesFernDensity.containsKey(biome)) {
            double density = biomesFernDensity.get(biome);
            if (random.nextFloat() < density) {
                species = GrassSpecies.FERN_LIKE;
            }
View Full Code Here

    }

    @Override
    public void populate(World world, Random random, Chunk chunk) {
        int amount = defaultAmount;
        final Biome biome = world.getBiome(chunk.getX() << 4, chunk.getZ() << 4);
        if (biomesDecorations.containsKey(biome)) {
            amount = biomesDecorations.get(biome);
        }
        for (int i = 0; i < amount; i++) {
            decorate(world, random, chunk);
View Full Code Here

        int chunkX = source.getX() * 16;
        int chunkZ = source.getZ() * 16;
        ChunkSnapshot snapshot = source.getChunkSnapshot();
        for (int x = 0; x < 16; x++) {
            for (int z = 0; z < 16; z++) {
                Biome biome = world.getBiome(x + chunkX, z + chunkZ);
                if (biome != Biome.TAIGA) {
                    continue;
                }

                int y = snapshot.getHighestBlockYAt(x, z);
View Full Code Here

    return generator.oreProvider.remapBiome(biome);
  }

  @Override
  public void preGenerateChunk(WorldGenerator generator, PlatLot lot, ByteChunk chunk, BiomeGrid biomes, CachedYs blockYs) {
    Biome biome = lot.getChunkBiome();
    OreProvider ores = generator.oreProvider;
//    boolean surfaceCaves = isSurfaceCaveAt(chunk.chunkX, chunk.chunkZ);
    boolean flattened = blockYs.segmentWidth > 1;
   
    // shape the world
View Full Code Here

    return NoiseGenerator.floor(terrainAt + noiseAt) + midPoint;
  }
 
  @Override
  public void preGenerateChunk(WorldGenerator generator, PlatLot lot, ByteChunk chunk, BiomeGrid biomes, CachedYs blockYs) {
    Biome resultBiome = lot.getChunkBiome();
    OreProvider ores = generator.oreProvider;
   
    // shape the world
    for (int x = 0; x < chunk.width; x++) {
      for (int z = 0; z < chunk.width; z++) {
View Full Code Here

    return generator.oreProvider.remapBiome(biome);
  }

  @Override
  public void preGenerateChunk(WorldGenerator generator, PlatLot lot, ByteChunk chunk, BiomeGrid biomes, CachedYs blockYs) {
    Biome biome = lot.getChunkBiome();
    OreProvider ores = generator.oreProvider;
    boolean surfaceCaves = isSurfaceCaveAt(chunk.chunkX, chunk.chunkZ);
   
    // shape the world
    for (int x = 0; x < chunk.width; x++) {
View Full Code Here

TOP

Related Classes of org.bukkit.block.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.