@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockForm(final BlockFormEvent event) { Block b = event.getBlock(); if (PlotManager.isPlotWorld(b)) { String id = PlotManager.getPlotId(b.getLocation()); if (id.equalsIgnoreCase("")) { event.setCancelled(true); } } }
/* * Called when a block is formed based on world conditions. */ @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockForm(BlockFormEvent event) { ConfigurationManager cfg = plugin.getGlobalStateManager(); WorldConfiguration wcfg = cfg.get(event.getBlock().getWorld()); if (cfg.activityHaltToggle) { event.setCancelled(true); return; } int type = event.getNewState().getTypeId(); if (type == BlockID.ICE) { if (wcfg.disableIceFormation) { event.setCancelled(true); return; } if (wcfg.useRegions && !plugin .getGlobalRegionManager() .allows(DefaultFlag.ICE_FORM, event.getBlock().getLocation())) { event.setCancelled(true); return; } } if (type == BlockID.SNOW) { if (wcfg.disableSnowFormation) { event.setCancelled(true); return; } if (wcfg.useRegions && !plugin .getGlobalRegionManager() .allows(DefaultFlag.SNOW_FALL, event.getBlock().getLocation())) { event.setCancelled(true); return; } } }
/* */ @EventHandler /* */ public void onBlockForm(BlockFormEvent event) /* */ { /* 41 */ if (this.noFreeze) /* 42 */ event.setCancelled(true); /* */ }
@EventHandler public void BlockFormEvent(BlockFormEvent event) { if (!arena.getRegion().isInside(event.getBlock().getLocation()) || arena.getEditMode()) return; event.setCancelled(true); }