@EventHandler public void onLeavesDecay(LeavesDecayEvent event) throws InterruptedException { if (disabling) { return; } Block block = event.getBlock(); if (plugin.needsCheck.contains(block)) { plugin.needsCheck.remove(block); } if (plugin.monitorBlocks.contains(block)) { while (plugin.isUpdatingChecks) { Thread.sleep(25); } plugin.monitorBlocks.remove(block); } }
@EventHandler(priority=EventPriority.HIGHEST, ignoreCancelled = true) public void onLeafDecay(LeavesDecayEvent e) { Block block = e.getBlock(); Location loc = block.getLocation(); if (!pendingChecks.contains(loc)) { pendingChecks.add(loc); handleBreak(block, BreakType.NATURAL, null, null); } }
@EventHandler public void onLeaveDecay(LeavesDecayEvent e) { if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Leave-Decay.Disable")) { if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Leave-Decay.World.All_World")) { if (WorldUtils.getWLD().contains(e.getBlock().getWorld().getName())) { e.setCancelled(true); } } else { e.setCancelled(true); } } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onDecay(LeavesDecayEvent e) { dropFruitFromTree(e.getBlock()); ItemStack item = BlockStorage.retrieve(e.getBlock()); if (item != null) { e.setCancelled(true); e.getBlock().setType(Material.AIR); e.getBlock().getWorld().dropItemNaturally(e.getBlock().getLocation(), item); } }
@EventHandler(priority = EventPriority.LOWEST) public void onLeafDecay(LeavesDecayEvent event) { Block block = event.getBlock(); Flag flag = this.GetFlagInstanceAtLocation(block.getLocation(), null); if(flag == null) return; event.setCancelled(true); }
@EventHandler(ignoreCancelled = false) public void onLeavesDecay(cn.nukkit.event.block.LeavesDecayEvent event) { if (canIgnore(LeavesDecayEvent.getHandlerList())) { return; } cn.nukkit.block.Block leaves = event.getBlock(); LeavesDecayEvent bukkitEvent = new LeavesDecayEvent(PokkitBlock.toBukkit(leaves)); callCancellable(event, bukkitEvent); }
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true) public void onLeafDecay(final LeafDecayHook hook) { LeavesDecayEvent event = new LeavesDecayEvent(new CanaryBlock(hook.getBlock())); event.setCancelled(hook.isCanceled()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { hook.setCanceled(); } }
@EventHandler public void onLeafDecay(LeavesDecayEvent e){ RedProtect.get().logger.debug("RPBlockListener - Is LeavesDecayEvent event"); Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation()); if (r == null && !RPConfig.getGlobalFlagBool(e.getBlock().getWorld().getName()+".allow-changes-of.leaves-decay")){ e.setCancelled(true); } }
@EventHandler public void onLeafDecay(LeavesDecayEvent e){ RedProtect.get().logger.debug("RPBlockListener - Is LeavesDecayEvent event"); if (e.isCancelled()){ return; } Region r = RedProtect.get().rm.getTopRegion(e.getBlock().getLocation()); if (r != null && !r.leavesDecay()){ e.setCancelled(true); } }
private void e(World world, int i, int j, int k) { // CraftBukkit start LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(i, j, k)); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end this.b(world, i, j, k, world.getData(i, j, k), 0); world.setAir(i, j, k); }
/** * On leaves decay. * * @param event the event */ @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onLeavesDecay(LeavesDecayEvent event) { IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea(event.getBlock().getLocation()); if (land.getFlagAndInherit(FlagList.LEAF_DECAY.getFlagType()).getValueBoolean() == false) { event.setCancelled(true); } }
private void removeLeaves(World p_150126_1_, int p_150126_2_, int p_150126_3_, int p_150126_4_) { // CraftBukkit start LeavesDecayEvent event = new LeavesDecayEvent(p_150126_1_.getWorld().getBlockAt(p_150126_2_, p_150126_3_, p_150126_4_)); p_150126_1_.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { return; } // CraftBukkit end this.dropBlockAsItem(p_150126_1_, p_150126_2_, p_150126_3_, p_150126_4_, p_150126_1_.getBlockMetadata(p_150126_2_, p_150126_3_, p_150126_4_), 0); p_150126_1_.setBlockToAir(p_150126_2_, p_150126_3_, p_150126_4_); }
@EventHandler(priority = EventPriority.MONITOR) public void onLeavesDecay(LeavesDecayEvent event) { if (event.isCancelled()) return; Block breakBlock = event.getBlock(); if (!detectBlockBreakAll && !detectBlockBreakLeaves) { return; } plugin.blockBreak(breakBlock, breakBlock.getLocation().clone().add(1, 0, 0)); }
@EventHandler public void onLeavesDecay(LeavesDecayEvent event) { Block block = event.getBlock(); String world = block.getWorld().getUID().toString(); Integer x = block.getLocation().getChunk().getX(), z = block.getLocation().getChunk().getZ(); if (QuickChecks.isWorldChunkClaimed(serverdata.get("worldmap").get(world), x, z, "cla")) { if (((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).containsKey("str")) { event.setCancelled(true); } } }
private void b(World world, BlockPosition blockposition) { // CraftBukkit start LeavesDecayEvent event = new LeavesDecayEvent(world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ())); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled() || world.getType(blockposition).getBlock() != this) { return; } // CraftBukkit end this.b(world, blockposition, world.getType(blockposition), 0); world.setAir(blockposition); }
@SuppressWarnings("deprecation") @EventHandler public void onLeaveDecay(LeavesDecayEvent e) { if(e.isCancelled()) { return; } byte sub = e.getBlock().getData(); Material mat = e.getBlock().getType(); FallingBlock fall = e.getBlock().getWorld().spawnFallingBlock(e.getBlock().getLocation(), mat.getId(), sub); fall.setMetadata("tree", new FixedMetadataValue(pl, "a tree")); e.getBlock().setType(Material.AIR); }
@EventHandler public void onLeafDecay(LeavesDecayEvent event) { event.setCancelled(true); }
@EventHandler(priority = EventPriority.HIGH) public void noBucket(final LeavesDecayEvent event) { event.setCancelled(true); }
private void removeTree(Block block, boolean nearwood, int range) { if (range < 0 || block.hasMetadata("placed")) return; this.plugin.getServer().getScheduler().runTask(this.plugin, () -> { if (block.getType() == Material.LEAVES || block.getType() == Material.LEAVES_2) { LeavesDecayEvent event = new LeavesDecayEvent(block); Bukkit.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) return; block.breakNaturally(); if (10 > new Random().nextInt(100)) block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, Material.LEAVES); } if (block.getType() == Material.LOG || block.getType() == Material.LOG_2) { for (ItemStack item : block.getDrops()) block.getWorld().dropItemNaturally(block.getLocation(), item); block.setType(Material.AIR); } for (int y = -1; y <= 1; y++) { for (int z = -1; z <= 1; z++) { for (int x = -1; x <= 1; x++) { Block block1 = block.getRelative(x, y, z); if (block != null) { if (block1.getType() == Material.LOG || block1.getType() == Material.LOG_2) { removeTree(block1, nearwood, range - ((z == 0 && x == 0 || nearwood) ? 0 : 1)); } else if (block1.getType() == Material.LEAVES || block1.getType() == Material.LEAVES_2) { int finalZ = z; int finalX = x; this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> { if (!this.isNearWood(block1, 2)) this.plugin.getServer().getScheduler().runTask(this.plugin, () -> removeTree(block1, false, nearwood ? 4 : (range - ((finalZ == 0 && finalX == 0) ? 0 : 1)))); }); } } } } } }); }
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onLeavesDecay(LeavesDecayEvent e) { e.setCancelled(true); }
@EventHandler public void onLeavesDecay(LeavesDecayEvent event) { event.setCancelled(true); }
@EventHandler(priority = EventPriority.MONITOR) public void onLeafDecay(LeavesDecayEvent event) { if(!event.isCancelled()) { logChunk(event.getBlock().getLocation()); } }
@EventHandler(ignoreCancelled = true) public void onLeavesDecay(final LeavesDecayEvent event) { TreeRecorder.remove(mPlugin, event.getBlock()); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onLeavesDecay(LeavesDecayEvent event) { this.setAndLog(BlockDecay.class, event.getBlock().getState(), AIR); }
@EventHandler(priority = EventPriority.NORMAL) public void onLeavesDecay(LeavesDecayEvent event) { event.setCancelled(true); }
@EventHandler(priority = EventPriority.LOW) public void onDecay(LeavesDecayEvent e) { e.setCancelled(true); }
@EventHandler(priority = EventPriority.LOWEST) public void leafDecay(LeavesDecayEvent e) { if (isDedicated() || isNotBlacklist(e.getBlock().getWorld().getName())) { e.setCancelled(true); } }
@EventHandler public void e(LeavesDecayEvent event) { event.setCancelled(true); }