当前位置: 首页>>代码示例>>Java>>正文


Java BlockDamageEvent.isCancelled方法代码示例

本文整理汇总了Java中org.bukkit.event.block.BlockDamageEvent.isCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java BlockDamageEvent.isCancelled方法的具体用法?Java BlockDamageEvent.isCancelled怎么用?Java BlockDamageEvent.isCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.event.block.BlockDamageEvent的用法示例。


在下文中一共展示了BlockDamageEvent.isCancelled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBlockDamage

import org.bukkit.event.block.BlockDamageEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void onBlockDamage(BlockDamageEvent event) {
    if (event.isCancelled() || !OrebfuscatorConfig.UpdateOnDamage) {
        return;
    }

    if (!BlockUpdate.needsUpdate(event.getBlock())) {
        return;
    }

    if (!BlockHitManager.hitBlock(event.getPlayer(), event.getBlock())) {
        return;
    }

    BlockUpdate.Update(event.getBlock());
}
 
开发者ID:SamaGames,项目名称:AntiCheat,代码行数:17,代码来源:OrebfuscatorBlockListener.java

示例2: checkBlockDamage

import org.bukkit.event.block.BlockDamageEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void checkBlockDamage(final BlockDamageEvent event) {
    MatchPlayer player = this.match.getParticipant(event.getPlayer());
    if(player == null) return;

    PlayerBlockEventQuery query = new PlayerBlockEventQuery(player, event, event.getBlock().getState());

    for(EventRule rule : this.ruleContext.get(EventRuleScope.BLOCK_BREAK)) {
        if(rule.earlyWarning() && rule.region().contains(event.getBlock())) {
            if(processQuery(rule, query)) {
                if(event.isCancelled() && rule.message() != null) {
                    player.sendWarning(rule.message(), true);
                }
                if(this.useRegionPriority) {
                    break;
                }
            }
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:21,代码来源:EventRuleMatchModule.java

示例3: onBlockDamage

import org.bukkit.event.block.BlockDamageEvent; //导入方法依赖的package包/类
/**
 * Filters BlockDamageEvent, Used for early warnings.
 *
 * <p>Applies to: block and block break<p/>
 */
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockDamage(BlockDamageEvent event) {
  Match match = Cardinal.getMatch(event.getPlayer());
  if (match == null || !match.hasPlayer(event.getPlayer())) {
    return;
  }
  for (AppliedRegion reg : get(match, ApplyType.BLOCK, ApplyType.BLOCK_BREAK)) {
    Block evaluating = event.getBlock();

    if (apply(reg, evaluating.getLocation(), event.getPlayer(), event, event, evaluating, event.getPlayer())) {
      if (event.isCancelled()) {
        event.setCancelled(false);
      }
      break;
    }
  }
}
 
开发者ID:CardinalDevelopment,项目名称:Cardinal,代码行数:23,代码来源:AppliedModule.java

示例4: onBlockDamage

import org.bukkit.event.block.BlockDamageEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockDamage(BlockDamageEvent event) {
  Sign sign;
  if (!event.isCancelled()
      && event.getBlock() != null
      && (event.getBlock().getType() == Material.WALL_SIGN || event
          .getBlock().getType() == Material.SIGN_POST)) {
    sign = (Sign) event.getBlock().getState();

    if (sign.getLine(0).equals(
        "" + ChatColor.GRAY + ChatColor.BOLD + "[" + ChatColor.YELLOW + "ATM"
            + ChatColor.GRAY + "]")
        && !tgym.Vault.HasPermissions(event.getPlayer(), "tgym.atm.create"))
      event.setCancelled(true);
  }
}
 
开发者ID:Vild,项目名称:TimeGivesYouMoney,代码行数:17,代码来源:BlockListener.java


注:本文中的org.bukkit.event.block.BlockDamageEvent.isCancelled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。