public void onBlockForm(BlockFormEvent event) { // If the arena isn't protected, care if (!protect) return; if (!arena.getRegion().contains(event.getBlock().getLocation())) return; // If a snowman forms some snow on its path, add the block if (event.getNewState().getType() == Material.SNOW) arena.addBlock(event.getBlock()); }
@EventHandler public void blockFormEvent(BlockFormEvent event) { if (event.getNewState().getType() == Material.ICE) { WorldClimateEngine climateEngine = ClimateEngine.getInstance().getClimateEngine(event.getBlock().getWorld().getUID()); if (climateEngine != null && climateEngine.isEffectEnabled(ClimateEffectType.ICE_FORMATION)) { if (event.getBlock().getY() < heightMap.getValue(climateEngine.getTemperature())) { event.setCancelled(true); } } } }
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockForm(final BlockFormEvent event) { if (TempBlock.isTempBlock(event.getBlock())) { event.setCancelled(true); } if (!WaterManipulation.canPhysicsChange(event.getBlock())) { event.setCancelled(true); } if (!EarthPassive.canPhysicsChange(event.getBlock())) { event.setCancelled(true); } if (event.getBlock().getType().toString().equals("CONCRETE_POWDER")) { final BlockFace[] faces = new BlockFace[] { BlockFace.UP, BlockFace.DOWN, BlockFace.EAST, BlockFace.WEST, BlockFace.NORTH, BlockFace.SOUTH }; boolean marked = true; for (final BlockFace face : faces) { final Block b = event.getBlock().getRelative(face); if (b.getType() == Material.WATER || b.getType() == Material.STATIONARY_WATER) { if (!TempBlock.isTempBlock(b)) { marked = false; // if there is any normal water around it, prevent it. break; } } } if (marked) { event.setCancelled(true); } } }
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true) public void onBlockForm(BlockFormEvent event) { Location loc = event.getBlock().getLocation(); String wn = getWorld(loc.getWorld()).getName(); sscache.invalidateSnapshot(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); mapManager.touch(wn, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), "blockform"); } };
@EventHandler public void blockFormEvent(BlockFormEvent event) { if (event.getNewState().getType() == Material.SNOW) { WorldClimateEngine climateEngine = ClimateEngine.getInstance().getClimateEngine(event.getBlock().getWorld().getUID()); if (climateEngine != null && climateEngine.isEffectEnabled(ClimateEffectType.SNOW_FORMATION)) { double temperature = climateEngine.getTemperature(); if (event.getBlock().getY() < heightMap.getValue(temperature)) { event.setCancelled(true); } } } }
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST) public void onForm(BlockFormEvent event) { Block block = event.getBlock(); Location location = block.getLocation(); if(GriefPrevention.instance.creativeRulesApply(location)) { Material type = block.getType(); if(type == Material.COBBLESTONE || type == Material.OBSIDIAN || type == Material.STATIONARY_LAVA || type == Material.STATIONARY_WATER) { Claim claim = GriefPrevention.instance.dataStore.getClaimAt(location, false, null); if(claim == null) { event.setCancelled(true); } } } }
private void onBlockForm(final BlockFormEvent event) { final Block block = event.getBlock(); if (block != null) { // TODO: Filter by player activity. tracker.addBlocks(block); } }
@EventHandler(ignoreCancelled = true) public void onForm(BlockFormEvent form) { if (form.getNewState().getType() != Material.SNOW) { return; } Game game = BedwarsRel.getInstance().getGameManager().getGameByLocation(form.getBlock().getLocation()); if (game == null) { return; } if (game.getState() == GameState.STOPPED) { return; } form.setCancelled(true); }
@EventHandler(ignoreCancelled = true) public void onForm(BlockFormEvent form) { if (form.getNewState().getType() != Material.SNOW) { return; } Game game = BedwarsRel.getInstance().getGameManager().getGameByLocation(form.getBlock().getLocation()); if (game == null) { return; } if (game.getState() == GameState.STOPPED) { return; } form.setCancelled(true); }
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onBlockForm(BlockFormEvent event) { ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager(); WorldConfiguration wcfg = getWorldConfig(event.getBlock().getWorld()); event.setCancelled(true); return; Material type = event.getNewState().getType(); event.setCancelled(true); return; event.setCancelled(true); return; .queryState(BukkitAdapter.adapt(event.getBlock().getLocation()), (RegionAssociable) null, Flags.ICE_FORM))) { event.setCancelled(true); return; event.setCancelled(true); return; Material targetId = event.getBlock().getRelative(0, -1, 0).getType(); event.setCancelled(true); return; .queryState(BukkitAdapter.adapt(event.getBlock().getLocation()), (RegionAssociable) null, Flags.SNOW_FALL))) { event.setCancelled(true);