org.bukkit.event.block.BlockFadeEvent#setCancelled ( )源码实例Demo

下面列出了org.bukkit.event.block.BlockFadeEvent#setCancelled ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: BedWars   文件: WorldListener.java
@EventHandler
public void onFade(BlockFadeEvent event) {
    if (event.isCancelled()) {
        return;
    }

    for (String s : Main.getGameNames()) {
        Game game = Main.getGame(s);
        if (game.getStatus() == GameStatus.RUNNING || game.getStatus() == GameStatus.GAME_END_CELEBRATING) {
            if (GameCreator.isInArea(event.getBlock().getLocation(), game.getPos1(), game.getPos2())) {
                if (!game.isBlockAddedDuringGame(event.getBlock().getLocation())) {
                    event.setCancelled(true);
                }
                return;
            }
        }
    }
}
 
源代码2 项目: BedWars   文件: WorldListener.java
@EventHandler
public void onFade(BlockFadeEvent event) {
    if (event.isCancelled()) {
        return;
    }

    for (String s : Main.getGameNames()) {
        Game game = Main.getGame(s);
        if (game.getStatus() == GameStatus.RUNNING || game.getStatus() == GameStatus.GAME_END_CELEBRATING) {
            if (GameCreator.isInArea(event.getBlock().getLocation(), game.getPos1(), game.getPos2())) {
                if (!game.isBlockAddedDuringGame(event.getBlock().getLocation())) {
                    event.setCancelled(true);
                }
                return;
            }
        }
    }
}
 
源代码3 项目: BedwarsRel   文件: BlockListener.java
@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);
  }
}
 
源代码4 项目: DungeonsXL   文件: DWorldListener.java
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    GameWorld gameWorld = plugin.getGameWorld(event.getBlock().getWorld());
    if (gameWorld == null) {
        return;
    }

    if (!gameWorld.isPlaying()) {
        event.setCancelled(true);
        return;
    }

    Set<ExItem> blockFadeDisabled = gameWorld.getGame().getRules().getState(GameRule.BLOCK_FADE_DISABLED);
    if (blockFadeDisabled == null) {
        return;
    }
    if (gameWorld.getGame() != null && blockFadeDisabled.contains(VanillaItem.get(event.getBlock().getType()))) {
        event.setCancelled(true);
    }
}
 
源代码5 项目: PlotMe-Core   文件: BukkitPlotListener.java
@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));

        }
    }
}
 
源代码6 项目: ProjectAres   文件: EnvironmentControlListener.java
@EventHandler(priority = EventPriority.HIGH)
public void noFade(final BlockFadeEvent event) {
    event.setCancelled(true);
}
 
源代码7 项目: FunnyGuilds   文件: GuildHeartProtectionHandler.java
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (isGuildHeart(event.getBlock())) {
        event.setCancelled(true);
    }
}
 
源代码8 项目: CardinalPGM   文件: WorldFreeze.java
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
 
源代码9 项目: CardinalPGM   文件: BlockEventRegion.java
@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);
    }
}
 
 同类方法