类org.bukkit.event.block.BlockFadeEvent源码实例Demo

下面列出了怎么用org.bukkit.event.block.BlockFadeEvent的API类实例代码及写法,或者点击链接到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 项目: BlueMap   文件: EventForwarder.java
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockChange(BlockFadeEvent evt) {
	onBlockChange(evt.getBlock().getLocation());
}
 
源代码7 项目: GriefDefender   文件: BlockEventHandler.java
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockFadeEvent(BlockFadeEvent event) {
    CommonBlockEventHandler.getInstance().handleBlockModify(event, event.getBlock(), event.getNewState());
}
 
源代码8 项目: PGM   文件: BlockTransformListener.java
@EventWrapper
public void onBlockFade(final BlockFadeEvent event) {
  BlockState state = event.getBlock().getState();
  this.callEvent(new BlockTransformEvent(event, state, BlockStates.toAir(state)));
}
 
源代码9 项目: ProjectAres   文件: BlockTransformListener.java
@EventWrapper
public void onBlockFade(final BlockFadeEvent event) {
    BlockState state = event.getBlock().getState();
    this.callEvent(new BlockTransformEvent(event, state, BlockStateUtils.toAir(state)));
}
 
源代码10 项目: ProjectAres   文件: EnvironmentControlListener.java
@EventHandler(priority = EventPriority.HIGH)
public void noFade(final BlockFadeEvent event) {
    event.setCancelled(true);
}
 
源代码11 项目: FunnyGuilds   文件: GuildHeartProtectionHandler.java
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (isGuildHeart(event.getBlock())) {
        event.setCancelled(true);
    }
}
 
源代码12 项目: CardinalPGM   文件: WorldFreeze.java
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
    if (!match.isRunning()) {
        event.setCancelled(true);
    }
}
 
源代码13 项目: 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);
    }
}
 
源代码14 项目: Survival-Games   文件: LoggingManager.java
@EventHandler(priority = EventPriority.MONITOR)
public void blockChanged(BlockFadeEvent e){
	if(e.isCancelled())return;

	logBlockDestoryed(e.getBlock());
	i.put("BFADE", i.get("BFADE")+1);

	//    System.out.println(3);

}
 
 类所在包
 类方法
 同包方法