本文整理汇总了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));
});
}
示例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);
}
}
}
示例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());
}
}
示例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();
}
}
}
示例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);
}
}
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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());
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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());
}