public static String getBiome(BlockGrowEvent e) { if (tc != null) { String tControl = TerrainControl.getBiomeName(e.getBlock().getWorld().getName(), e.getBlock().getLocation().getBlockX(), e.getBlock().getLocation().getBlockZ()); if (tControl != null) { return tControl; } else { return String.valueOf(e.getBlock().getBiome()); } } else { return String.valueOf(e.getBlock().getBiome()); } }
@EventHandler(ignoreCancelled = false) public void onBlockGrowing(cn.nukkit.event.block.BlockGrowEvent event) { if (canIgnore(BlockGrowEvent.getHandlerList())) { return; } cn.nukkit.block.Block growing = event.getBlock(); BlockGrowEvent bukkitEvent = new BlockGrowEvent(PokkitBlock.toBukkit(growing), PokkitBlockState.getBlockState(PokkitBlock.toBukkit(event.getNewState()))); callCancellable(event, bukkitEvent); }
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true) public void onBlockGrowth(final BlockGrowHook hook) { BlockGrowEvent event = new BlockGrowEvent(new CanaryBlock(hook.getOriginal()), null); event.setCancelled(hook.isCanceled()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { hook.setCanceled(); } // TODO: Fill in second argument }
@EventHandler(ignoreCancelled = true) public void onBlockGrow(BlockGrowEvent grow) { Game game = BedwarsRel.getInstance().getGameManager().getGameByLocation(grow.getBlock().getLocation()); if (game == null) { return; } grow.setCancelled(true); }
@EventHandler public void onBlockGrow(BlockGrowEvent event) { RedProtect.get().logger.debug("RPBlockListener - Is BlockGrowEvent event: "+event.getNewState().getType().name()); if (event.isCancelled()){ return; } Region r = RedProtect.get().rm.getTopRegion(event.getBlock().getLocation()); if (r != null && !r.canGrow()){ event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGHEST) public void onBlockGrow(BlockGrowEvent e) { String w = e.getBlock().getWorld().getName(); for (String p : worlds.keySet()) { for (int i = 0; i < worlds.get(p).size(); i++) { if (worlds.get(p).get(i).equals(w)) { if (!Minigame.getMinigameInstance(p).getConfigManager().isBlockGrowAllowed()) { e.setCancelled(true); break; } } } } }
@EventHandler(priority = EventPriority.NORMAL) public void onBlockGrow(final BlockGrowEvent event) { if (event.isCancelled()) return; final Block block = event.getNewState().getBlock(); final WorldCoord coord = new WorldCoord(block); // Stop sugarcane blocks from growing if (BlockUtil.isStandableGateMaterial(event.getNewState().getType()) && Gates.gateFromPortalSurround(coord) != null) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onGrow(final BlockGrowEvent e) { final Block b = e.getBlock(); final Location loc = BukkitUtil.getLocation(b.getLocation()); if (PlotSquared.isPlotWorld(loc.getWorld())) { if (MainUtil.isPlotRoad(loc)) { e.setCancelled(true); } } }
@EventHandler(priority = EventPriority.NORMAL) public void onBlockGrowEvent(BlockGrowEvent event) { bcoord.setFromLocation(event.getBlock().getLocation().add(0, -1, 0)); if (CivGlobal.vanillaGrowthLocations.contains(bcoord)) { /* Allow vanilla growth on these plots. */ return; } Block b = event.getBlock(); if (Farm.isBlockControlled(b)) { event.setCancelled(true); } }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockGrow(BlockGrowEvent event) { Location location = BukkitUtil.adapt(event.getBlock().getLocation()); if (manager.isPlotWorld(location)) { PlotId id = manager.getPlotId(location); if (id == null) { event.setCancelled(true); } else { event.setCancelled(api.isPlotLocked(id)); } } }
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onGrow(BlockGrowEvent event) { Block b = event.getBlock(); Location location = BukkitUtil.getLocation(b.getLocation()); if (location.isUnownedPlotArea()) { event.setCancelled(true); } }
@EventHandler private void onGrow(final BlockGrowEvent event) { ProtectedArea area = Areas.findArea(event.getBlock().getLocation()); if (area != null) { event.setCancelled(true); } }
@EventHandler public void onBlockGrow(BlockGrowEvent event) { event.setCancelled(true); }
@EventWrapper public void onBlockForm(final BlockGrowEvent event) { this.callEvent(new BlockTransformEvent(event, event.getBlock().getState(), event.getNewState())); }
@EventHandler(ignoreCancelled = true) public void onBlockGrow(BlockGrowEvent event) { this.post(event, event.getBlock().getState(), event.getNewState()); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockGrow(BlockGrowEvent event) { RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event); }
@EventHandler(priority = EventPriority.MONITOR) public void onBlockGrow(BlockGrowEvent event) { if(!event.isCancelled()) { logChunk(event.getBlock().getLocation()); } }
@EventHandler public void onBlockGrow(BlockGrowEvent event) { if (!match.isRunning()) { event.setCancelled(true); } }
@EventHandler public void onBlockGrow(BlockGrowEvent event) { if (filter.evaluate(event.getBlock(), event).equals(FilterState.DENY) && region.contains(new BlockRegion(null, event.getBlock().getLocation().toVector()))) { event.setCancelled(true); } }
public List<List<String>> specialBlockList(BlockGrowEvent e) { List<String> fBlocksFound = new ArrayList<String>(); List<String> wkBlocksFound = new ArrayList<String>(); List<String> uvBlocksFound = new ArrayList<String>();; List<List<String>> result = new ArrayList<List<String>>(); // Check for fertilizer blocks if (PwnPlantGrowth.fenabled) { for (int fx = -(PwnPlantGrowth.fradius); fx <= PwnPlantGrowth.fradius; fx++) { for (int fy = -(PwnPlantGrowth.fradius); fy <= PwnPlantGrowth.fradius; fy++) { for (int fz = -(PwnPlantGrowth.fradius); fz <= PwnPlantGrowth.fradius; fz++) { fBlocksFound.add(String.valueOf(e.getBlock().getRelative(fx, fy, fz).getType())); } } } } // Check for weed killer blocks if (PwnPlantGrowth.wkenabled) { for (int wx = -(PwnPlantGrowth.wkradius); wx <= PwnPlantGrowth.wkradius; wx++) { for (int wy = -(PwnPlantGrowth.wkradius); wy <= PwnPlantGrowth.wkradius; wy++) { for (int wz = -(PwnPlantGrowth.wkradius); wz <= PwnPlantGrowth.wkradius; wz++) { wkBlocksFound.add(String.valueOf(e.getBlock().getRelative(wx, wy, wz).getType())); } } } } // Check for uv blocks if (PwnPlantGrowth.uvenabled) { for (int ux = -(PwnPlantGrowth.uvradius); ux <= PwnPlantGrowth.uvradius; ux++) { for (int uy = -(PwnPlantGrowth.uvradius); uy <= PwnPlantGrowth.uvradius; uy++) { for (int uz = -(PwnPlantGrowth.uvradius); uz <= PwnPlantGrowth.uvradius; uz++) { uvBlocksFound.add(String.valueOf(e.getBlock().getRelative(ux, uy, uz).getType())); } } } } result.add(fBlocksFound); result.add(wkBlocksFound); result.add(uvBlocksFound); return result; }
@EventHandler public void e(BlockGrowEvent event) { event.setCancelled(true); }