@Override public MCBlock getIgnitingBlock() { if(event.getIgnitingBlock() != null) { return new BukkitMCBlock(event.getIgnitingBlock()); } return null; }
@EventHandler(ignoreCancelled = true) public void onIgnite(BlockIgniteEvent ignite) { if (ignite.getIgnitingBlock() == null && ignite.getIgnitingEntity() == null) { return; if (ignite.getIgnitingBlock() == null) { if (ignite.getIgnitingEntity() instanceof Player) { game = BedwarsRel.getInstance().getGameManager() .getGameByLocation(ignite.getIgnitingBlock().getLocation()); if (!game.getRegion().isPlacedBlock(ignite.getIgnitingBlock()) && ignite.getIgnitingBlock() != null) { game.getRegion().addPlacedBlock(ignite.getIgnitingBlock(), ignite.getIgnitingBlock().getState());
@EventHandler(ignoreCancelled = true) public void onBlockIgnite(BlockIgniteEvent event) { Block block = event.getBlock(); Cause cause; // Find the cause if (event.getPlayer() != null) { cause = create(event.getPlayer()); } else if (event.getIgnitingEntity() != null) { cause = create(event.getIgnitingEntity()); } else if (event.getIgnitingBlock() != null) { cause = create(event.getIgnitingBlock()); } else { cause = Cause.unknown(); } Events.fireToCancel(event, new PlaceBlockEvent(event, cause, block.getLocation(), Material.FIRE)); }
@EventHandler(ignoreCancelled = true) public void onIgnite(BlockIgniteEvent ignite) { if (ignite.getIgnitingBlock() == null && ignite.getIgnitingEntity() == null) { return; if (ignite.getIgnitingBlock() == null) { if (ignite.getIgnitingEntity() instanceof Player) { game = BedwarsRel.getInstance().getGameManager() .getGameByLocation(ignite.getIgnitingBlock().getLocation()); if (!game.getRegion().isPlacedBlock(ignite.getIgnitingBlock()) && ignite.getIgnitingBlock() != null) { game.getRegion().addPlacedBlock(ignite.getIgnitingBlock(), ignite.getIgnitingBlock().getState());
Block ignitingBlock = event.getIgnitingBlock(); Block targetBlock = event.getBlock(); if (ignitingBlock != null)