@EventHandler(ignoreCancelled = true) public void onFade(BlockFadeEvent e) { Game game = BedwarsRel.getInstance().getGameManager() .getGameByLocation(e.getBlock().getLocation()); if (game == null) { return; } if (game.getState() == GameState.STOPPED) { return; } if (!game.getRegion().isPlacedBlock(e.getBlock())) { e.setCancelled(true); } }
@EventHandler(priority = EventPriority.LOWEST) public void onBlockFade(final BlockFadeEvent event) { final Block block = event.getBlock(); final Location location = block.getLocation(); final Material material = block.getType(); if (!reinforcementManager.isWorldActive(location.getWorld().getName())) { return; } if (!Material.SNOW.equals(material) && !Material.ICE.equals(material) && !Material.SOIL.equals(material)) { return; } if (!reinforcementManager.isReinforced(location)) { return; } if (!allowBlockFading) { event.setCancelled(true); return; } Bukkit.getServer().getPluginManager().callEvent(new BlockDeinforceEvent(block, "Environment", true)); }
@EventHandler public void onBlockFade(BlockFadeEvent e) { if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.Disable")) { if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.World.All_World")) { if (WorldUtils.getWBF().contains(e.getBlock().getWorld().getName())) { e.setCancelled(true); } } else { e.setCancelled(true); } } }
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH) public void onBlockFade(BlockFadeEvent event) { switch (event.getBlock().getType()) { case SNOW: case ICE: event.setCancelled(true); break; default: break; } }
@EventHandler(priority = EventPriority.HIGHEST) public void onBlockFade(BlockFadeEvent e) { boolean cancelled = false; 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().isBlockFadeAllowed()) { e.setCancelled(true); cancelled = true; break; } } } } if (cancelled) { return; } Block adjBlock = MGUtil.getAttachedSign(e.getBlock()); if (adjBlock != null) { for (Minigame mg : Minigame.getMinigameInstances()) { for (LobbySign l : mg.getLobbyManager().signs.values()) { if (l.getX() == adjBlock.getX() && l.getY() == adjBlock.getY() && l.getZ() == adjBlock.getZ() && l.getWorld().equals(adjBlock.getWorld().getName())) { e.setCancelled(true); break; } } } } }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onFade(final BlockFadeEvent 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.HIGH, ignoreCancelled = true) public void onBlockFade(BlockFadeEvent 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 onFade(BlockFadeEvent event) { Block b = event.getBlock(); Location location = BukkitUtil.getLocation(b.getLocation()); PlotArea area = location.getPlotArea(); if (area == null) { return; } Plot plot = area.getOwnedPlot(location); if (plot == null) { event.setCancelled(true); return; } switch (b.getType()) { case ICE: if (Flags.ICE_MELT.isFalse(plot)) { event.setCancelled(true); } break; case SNOW: if (Flags.SNOW_MELT.isFalse(plot)) { event.setCancelled(true); } break; case SOIL: if (Flags.SOIL_DRY.isFalse(plot)) { event.setCancelled(true); } break; } }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { if (this.getConfig(event.getBlock().getWorld()).block.fade.ignore.contains(event.getBlock().getType())) { return; } this.setAndLog(BlockFade.class, event.getBlock().getState(), AIR); }
@EventHandler(ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { World world = event.getBlock().getWorld(); String biome = String.valueOf(event.getBlock().getBiome()); // if the biome has a bypass, allow ice to melt if (PwnBuckets.containsCaseInsensitive(biome, PwnBuckets.icemeltBypass)) { return; } if (PwnBuckets.isEnabledIn(world.getName())) { if(PwnBuckets.blockIceMelt) { //only care about water if(event.getNewState().getType() == Material.STATIONARY_WATER) { Block block = event.getBlock(); block.setType(Material.WATER); EvaporateWaterTask task = new EvaporateWaterTask(block); plugin.getServer().getScheduler().runTaskLater(plugin, task, 30L); event.setCancelled(true); if (PwnBuckets.logEnabled) { PwnBuckets.logToFile("Blocked water source from ice melt"); } } } } }
@EventHandler public void onBlockBurn(BlockFadeEvent 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); } } }
@EventHandler (priority = EventPriority.LOW, ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { final Block fading = event.getBlock(); //Don't do a lookup if it isn't soil. if (fading.getType() != Material.SOIL) { return; } final Block top = event.getBlock().getRelative((BlockFace.UP)); if (plugin.getWorldRegistry().contains(top.getWorld().getName(), top.getX(), top.getY(), top.getZ())) { event.setCancelled(true); } }
/** * Cancels block fade events in arenas not currently running. * @param event The {@link org.bukkit.event.block.BlockFadeEvent} event. */ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { Arena arena = ultimateGames.getArenaManager().getLocationArena(event.getBlock().getLocation()); if (arena != null && arena.getStatus() == ArenaStatus.RUNNING) { arena.getGame().getGamePlugin().onBlockFade(arena, event); } else { event.setCancelled(true); } }
@EventHandler public void onBlockFade(BlockFadeEvent event) { event.setCancelled(true); }
@EventWrapper public void onBlockFade(final BlockFadeEvent event) { BlockState state = event.getBlock().getState(); this.callEvent(new BlockTransformEvent(event, state, BlockStateUtils.toAir(state))); }
@EventHandler(priority = EventPriority.HIGH) public void noFade(final BlockFadeEvent event) { event.setCancelled(true); }
@EventHandler(ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { this.post(event, event.getBlock().getState(), event.getNewState()); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onBlockFade(BlockFadeEvent event) { RollbackAgent.checkBlockChange(event.getBlock().getLocation(), event.getBlock().getState(), event); }
@EventHandler public void onBlockFade(BlockFadeEvent event) { if(!event.isCancelled()) { logChunk(event.getBlock().getLocation()); } }
@EventHandler public void onBlockFade(BlockFadeEvent event) { if (!match.isRunning()) { event.setCancelled(true); } }
@EventHandler public void onBlockFade(BlockFadeEvent event) { if (filter.evaluate(event.getBlock(), event).equals(FilterState.DENY) && region.contains(new BlockRegion(null, event.getBlock().getLocation().toVector()))) { event.setCancelled(true); } }
/** * Handles blocks fading. * * @param arena The arena the block is in. * @param event The BlockFadeEvent. */ public void onBlockFade(Arena arena, BlockFadeEvent event) { }
@EventHandler public void e(BlockFadeEvent event) { event.setCancelled(true); }