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


Java EventPriority.MONITOR属性代码示例

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


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

示例1: join

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void join(PlayerJoinMatchEvent event) {
    event.getPlayer().getBukkit().hideTitle();

    final Match match = event.getMatch();
    final PlayerId viewerId = event.getPlayer().getPlayerId();

    match.getScheduler(MatchScope.LOADED).createDelayedTask(5L, () -> {
        final MatchPlayer viewer = match.getPlayer(viewerId);
        if(viewer == null) return;

        sendWelcomeMessage(viewer);
        match.module(SkillRequirementMatchModule.class).ifPresent(srmm -> srmm.sendFeedback(viewer));
        match.module(QuotaMatchModule.class).ifPresent(qmm -> qmm.sendQuotaInfo(viewer));
    });
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:16,代码来源:MatchAnnouncer.java

示例2: onBlockChange

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockChange(BlockTransformEvent event) {
    BlockState oldState = event.getOldState(), newState = event.getNewState();

    updateRenewablePool(newState);

    if(definition.growAdjacent) {
        for(BlockFace face : BlockFaces.NEIGHBORS) {
            updateRenewablePool(BlockFaces.getRelative(newState, face));
        }
    }

    if(isOriginalShuffleable(BlockUtils.position(newState))) {
        if(definition.shuffleableBlocks.query(new BlockQuery(oldState)).isAllowed()) {
            shuffleableMaterialDeficit.increment(oldState, 1);
        }

        if(definition.shuffleableBlocks.query(new BlockQuery(newState)).isAllowed()) {
            shuffleableMaterialDeficit.increment(newState, -1);
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:22,代码来源:Renewable.java

示例3: updateMonitoredHealth

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void updateMonitoredHealth(final EntityRegainHealthEvent event) {
    if(event.getEntity() instanceof Player) {
        Player player = (Player) event.getEntity();
        if(player.getHealth() == player.getMaxHealth()) return;
        this.scheduleCheck((Player) event.getEntity());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:8,代码来源:ViewInventoryMatchModule.java

示例4: onGrenadeExplode

@EventHandler(priority = EventPriority.MONITOR)
public void onGrenadeExplode(final ProjectileHitEvent event) {
    if (event.getEntity().getShooter() instanceof Player) {
        Grenade grenade = Grenade.get(event.getEntity());
        if(grenade != null) {
            NMSHacks.createExplosion(event.getEntity(), event.getEntity().getLocation(), grenade.power, grenade.fire, grenade.destroy);
            event.getEntity().remove();
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:10,代码来源:GrenadeListener.java

示例5: handleDeathBroadcast

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void handleDeathBroadcast(MatchPlayerDeathEvent event) {
    if(!event.getMatch().isRunning()) return;

    DeathMessageBuilder builder = new DeathMessageBuilder(event.getVictim(), event.getDamageInfo(), logger);
    Component message = new Component(builder.getMessage(), ChatColor.GRAY);

    if(event.isPredicted()) {
        message.extra(new Component(" "), new TranslatableComponent("death.predictedSuffix"));
    }

    final Identity victim = identityProvider.currentIdentity(event.getVictim().getBukkit());
    final Identity killer = event.getKiller() == null ? null : event.getKiller().getIdentity();

    for(MatchPlayer viewer : event.getMatch().getPlayers()) {
        final Player bukkit = viewer.getBukkit();
        final SettingManager settingManager = PlayerSettings.getManager(bukkit);
        final DeathMessageSetting.Options dms = settingManager.getValue(DeathMessageSetting.get(), DeathMessageSetting.Options.class);

        if(dms.isAllowed(victim.familiarity(bukkit)) || (killer != null && dms.isAllowed(killer.familiarity(bukkit)))) {
            if(event.isInvolved(viewer) && settingManager.getValue(HighlightDeathMessageSetting.get(), Boolean.class)) {
                viewer.sendMessage(new Component(message, ChatColor.BOLD));
            } else {
                viewer.sendMessage(message);
            }
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:28,代码来源:DeathMessageMatchModule.java

示例6: onPlayerQuit

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
    UUID uuid = event.getPlayer().getUniqueId();
    if (getRemaining(event.getPlayer().getUniqueId()) > 0L) {
        clearCooldown(uuid);
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:7,代码来源:LogoutTimer.java

示例7: onPlayerMove

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
private void onPlayerMove(CoarsePlayerMoveEvent event) {
    MatchPlayer player = getMatch().getParticipant(event.getPlayer());
    if(player != null &&
       getProximityMetricType(player.getCompetitor()) == ProximityMetric.Type.CLOSEST_PLAYER) {

        updateProximity(player.getParticipantState(), event.getBlockTo());
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:9,代码来源:ProximityGoal.java

示例8: onPlayerLeftFaction

@EventHandler(ignoreCancelled=true, priority=EventPriority.MONITOR)
public void onPlayerLeftFaction(PlayerLeftFactionEvent event)
{
  Optional<Player> optional = event.getPlayer();
  if (optional.isPresent())
  {
    Player player = (Player)optional.get();
    Collection<Player> players = event.getFaction().getOnlinePlayers();
    getPlayerBoard(event.getUniqueID()).addUpdates(players);
    for (Player target : players) {
      getPlayerBoard(target.getUniqueId()).addUpdate(player);
    }
  }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:14,代码来源:ScoreboardHandler.java

示例9: onEntityDamageByEntity

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
    Player attacker = BukkitUtils.getFinalAttacker(event, true);
    Entity entity;
    if (attacker != null && (entity = event.getEntity()) instanceof Player) {
        Player attacked = (Player) entity;
        setCooldown(attacker, attacker.getUniqueId(), defaultCooldown, false);
        setCooldown(attacked, attacked.getUniqueId(), defaultCooldown, false);
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:CombatTimer.java

示例10: afterPickupItem

@EventHandler(priority = EventPriority.MONITOR)
public void afterPickupItem(PlayerPickupItemEvent event) {
    Player player = event.getPlayer();

    if (!InventoryManager.playerIsLoaded(player)) {
        return;
    }

    ItemStack item = event.getItem().getItemStack();
    if (CustomItem.isCustomItem(item)) {
        ItemManager.updateStats(player);
    }
}
 
开发者ID:EndlessCodeGroup,项目名称:RPGInventory,代码行数:13,代码来源:ItemListener.java

示例11: onUnloadChunkMonitor

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onUnloadChunkMonitor(ChunkUnloadEvent e) {
	if (!cm.hotChunkEnabled || NeverLag.getTpsWatcher().getAverageTPS() < cm.hotChunkTpsThreshold) {
		return;
	}
	ChunkInfo chunkInfo = new ChunkInfo(e.getChunk());
	chunkUnLoadTime.put(chunkInfo, System.currentTimeMillis());
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:8,代码来源:HotChunkHolder.java

示例12: onPlayerQuit

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
    Player player = event.getPlayer();
    TimerCooldown runnable = cooldowns.get(player.getUniqueId());
    if (runnable != null && runnable.getRemaining() > 0L) {
        runnable.setPaused(true);
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:8,代码来源:InvincibilityTimer.java

示例13: onBlockExplode

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockExplode(EntityExplodeEvent event) {
    if (!this.tracker.isEnabled(event.getLocation().getWorld())) return;

    // Remove all blocks that are destroyed from explosion
    for (Block block : event.blockList()) {
        if (block.getType() == Material.ANVIL) {
            this.tracker.clearPlacer(block);
        }
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:11,代码来源:AnvilListener.java

示例14: onPlayerDamage

@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void onPlayerDamage(EntityDamageByEntityEvent event) {
    Entity entity = event.getEntity();
    if (entity instanceof Player && BukkitUtils.getFinalAttacker(event, false) != null) {
        Player player = (Player) entity;
        if (plugin.getPvpClassManager().hasClassEquipped(player, this)) {
            removeInvisibilitySafely(player);
        }
    }
}
 
开发者ID:funkemunky,项目名称:HCFCore,代码行数:10,代码来源:MinerClass.java

示例15: updateMonitoredTransform

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void updateMonitoredTransform(final PlayerBlockTransformEvent event) {
    MatchPlayer player = event.getPlayer();
    if(player != null) this.scheduleCheck(player.getBukkit());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:ViewInventoryMatchModule.java


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