org.bukkit.event.world.ChunkPopulateEvent Java Examples
The following examples show how to use
org.bukkit.event.world.ChunkPopulateEvent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventForwarder.java From BlueMap with MIT License | 5 votes |
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public synchronized void onChunkFinishedGeneration(ChunkPopulateEvent evt) { Chunk chunk = evt.getChunk(); UUID world = chunk.getWorld().getUID(); Vector2i chunkPos = new Vector2i(chunk.getX(), chunk.getZ()); listeners.forEach(l -> l.onChunkFinishedGeneration(world, chunkPos)); }
Example #2
Source File: PlantsListener.java From ExoticGarden with GNU General Public License v3.0 | 5 votes |
private void pasteTree(ChunkPopulateEvent e, int x, int z, Tree tree) { for (int y = e.getWorld().getMaxHeight(); y > 30; y--) { Block current = e.getWorld().getBlockAt(x, y, z); if (!current.getType().isSolid() && current.getType() != Material.WATER && current.getType() != Material.SEAGRASS && current.getType() != Material.TALL_SEAGRASS && !(current.getBlockData() instanceof Waterlogged && ((Waterlogged) current.getBlockData()).isWaterlogged()) && tree.isSoil(current.getRelative(0, -1, 0).getType()) && isFlat(current)) { Schematic.pasteSchematic(new Location(e.getWorld(), x, y, z), tree); break; } } }