本文整理汇总了Java中org.bukkit.event.EventPriority.NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java EventPriority.NORMAL属性的具体用法?Java EventPriority.NORMAL怎么用?Java EventPriority.NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.event.EventPriority
的用法示例。
在下文中一共展示了EventPriority.NORMAL属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlaceDropper
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlaceDropper(final BlockPlaceEvent e) {
if (!cm.tileLimitEnabled) {
return;
}
if (e.getBlock().getType() == Material.DROPPER) {
Player p = e.getPlayer();
if (p.isOp()) {
return;
}
int limit = NeverLagUtils.getMaxPermission(p, "neverlag.limit.dropper.");
if (limit <= 0) {
limit = cm.tileLimitDefaultDropper;
}
if (isLimit(e.getBlock().getLocation(), Material.DROPPER, limit)) {
e.setCancelled(true);
p.sendMessage(i18n.tr("message", limit));
}
}
}
示例2: onPlayerInteract
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerInteract(PlayerInteractEvent e) {
if (!cm.isDisableChangeSpawnerType) {
return;
}
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (e.getClickedBlock().getType() == Material.MOB_SPAWNER) {
if (e.getItem() == null) {
return;
}
if (e.getPlayer().isOp()) {
return;
}
if (e.getItem().getType() == Material.MONSTER_EGG || e.getItem().getType() == Material.MONSTER_EGGS) {
e.setCancelled(true);
}
}
}
}
示例3: onEntityDeath
@EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
public void onEntityDeath(EntityDeathEvent event) {
double amount = event.getDroppedExp();
Player killer = event.getEntity().getKiller();
if (killer != null && amount > 0) {
ItemStack stack = killer.getItemInHand();
if (stack != null && stack.getType() != Material.AIR) {
int enchantmentLevel = stack.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS);
if (enchantmentLevel > 0L) {
double multiplier = enchantmentLevel * SettingsYML.EXP_MULTIPLIER_LOOTING_PER_LEVEL;
int result = (int) Math.ceil(amount * multiplier);
event.setDroppedExp(result);
}
}
}
}
示例4: onTeleport
@EventHandler(ignoreCancelled=true, priority=EventPriority.NORMAL)
public void onTeleport(PlayerTeleportEvent event) {
if (event.getCause() == PlayerTeleportEvent.TeleportCause.ENDER_PEARL) {
Location to = event.getTo();
if (this.blockedTypes.contains(to.getBlock().getType())) {
event.setCancelled(true);
return;
}
to.setX(to.getBlockX() + 0.5D);
to.setZ(to.getBlockZ() + 0.5D);
event.setTo(to);
}
}
示例5: onInventoryOpen
@EventHandler(ignoreCancelled = false, priority = EventPriority.NORMAL)
public void onInventoryOpen(InventoryOpenEvent event) {
HumanEntity humanEntity = event.getPlayer();
if (humanEntity instanceof Player) {
Player player = (Player) humanEntity;
if (player.getInventory().contains(ClaimHandler.SUBCLAIM_WAND)) {
player.getInventory().remove(ClaimHandler.SUBCLAIM_WAND);
plugin.getClaimHandler().clearClaimSelection(player);
}
}
}
示例6: onFurnaceExtract
@EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
public void onFurnaceExtract(FurnaceExtractEvent event) {
double amount = event.getExpToDrop();
if (amount > 0) {
double multiplier = SettingsYML.EXP_MULTIPLIER_SMELTING;
int result = (int) Math.ceil(amount * multiplier);
event.setExpToDrop(result);
}
}
示例7: onPlayerPickup
@EventHandler(ignoreCancelled = false, priority = EventPriority.NORMAL)
public void onPlayerPickup(PlayerPickupItemEvent event) {
Item item = event.getItem();
if (isSubclaimWand(item.getItemStack())) {
item.remove();
plugin.getClaimHandler().clearClaimSelection(event.getPlayer());
}
}
示例8: onPlayerDrop
@EventHandler(ignoreCancelled = false, priority = EventPriority.NORMAL)
public void onPlayerDrop(PlayerDropItemEvent event) {
Item item = event.getItemDrop();
if (isClaimingWand(item.getItemStack())) {
item.remove();
plugin.getClaimHandler().clearClaimSelection(event.getPlayer());
}
}
示例9: onChat
@EventHandler(priority = EventPriority.NORMAL)
public void onChat(AsyncPlayerChatEvent event) {
if (config.getBoolean("settings.chat.game-to-dub")) {
try {
dtu.getRoom().sendMessage(config.getString("lang.chat.game-to-dub")
.replaceAll("%user%", event.getPlayer().getDisplayName())
.replaceAll("%message%", event.getMessage()));
} catch (IOException e) {
e.printStackTrace();
}
}
}
示例10: onEntityDamageByEntity
@EventHandler(ignoreCancelled = false, priority = EventPriority.NORMAL)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof Player) {
Player player = (Player) event.getDamager();
if (isClaimingWand(player.getItemInHand())) {
player.setItemInHand(new ItemStack(Material.AIR, 1));
plugin.getClaimHandler().clearClaimSelection(player);
}
}
}
示例11: onEntityDamageByEntity
@EventHandler(ignoreCancelled = false, priority = EventPriority.NORMAL)
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof Player) {
Player player = (Player) event.getDamager();
if (isSubclaimWand(player.getItemInHand())) {
player.setItemInHand(new ItemStack(Material.AIR, 1));
plugin.getClaimHandler().clearClaimSelection(player);
}
}
}
示例12: onBroadcastCommand
@EventHandler(priority = EventPriority.NORMAL)
public void onBroadcastCommand(ServerCommandEvent event) {
String cmd = ChatColor.stripColor(event.getCommand());
if (cmd.equals("broadcast ") || cmd.equals("bc ")) {
String msg = cmd.split(" ", 2)[1];
messenger.sendMessageToAllBoundChannel("\uD83D\uDCE2 " + msg);
boolean seeBc = configsManager.getModChannelConfig().getBoolean("See_Broadcast");
if(seeBc) {
messenger.sendMessageToAllModChannel("\uD83D\uDCE2 " + msg );
}
}
}
示例13: onBroadcastMessage
@EventHandler(priority = EventPriority.NORMAL)
public void onBroadcastMessage(BroadcastMessageEvent event) {
String msg = ChatColor.stripColor(event.getMessage());
boolean seeBc = configsManager.getModChannelConfig().getBoolean("See_Broadcast");
boolean seePlBc = configsManager.getBroadcastConfig().getBoolean("See_Plugin_Broadcast");
boolean privateBroadcast = isPrivate(event);
boolean seeCL = configsManager.getBroadcastConfig().getBoolean("See_ClearLag");
if (!privateBroadcast && seePlBc) {
boolean isClearLag = msg.contains("[ClearLag]");
if (isClearLag && seeCL) {
messenger.sendMessageToAllBoundChannel("\uD83D\uDCE2 " + msg);
if (seeBc) {
messenger.sendMessageToAllModChannel("\uD83D\uDCE2 " + msg);
}
} else if (!isClearLag) {
messenger.sendMessageToAllBoundChannel("\uD83D\uDCE2 " + msg);
if (seeBc) {
messenger.sendMessageToAllModChannel("\uD83D\uDCE2 " + msg);
}
}
} else if (privateBroadcast) {
boolean ismcMMOAdmin = mcb.getChatManager().getChatStatus().isIsmcmmoAdminChat();
boolean seemcMMOAdmin = mcb.getMcbConfigsManager().getModChannelConfig().getBoolean("See_mcMMO_Admin_Chat");
boolean ismcMMOParty = mcb.getChatManager().getChatStatus().ismcmmopartychat();
boolean seemcMMOParty = mcb.getMcbConfigsManager().getModChannelConfig().getBoolean("See_mcMMO_Admin_Chat");
if (ismcMMOAdmin && seemcMMOAdmin) {
msg = formatMessage(ChatListener.ChatType.MCMMO_ADMIN, msg);
messenger.sendMessageToAllModChannel(msg);
} else if (ismcMMOParty && seemcMMOParty) {
msg = formatMessage(ChatListener.ChatType.MCMMO_ADMIN, msg);
messenger.sendMessageToAllModChannel(msg);
} else if (mcb.getChatManager().getChatStatus().isCancelled()) {
msg = formatMessage(ChatListener.ChatType.MCMMO_ADMIN, msg);
messenger.sendMessageToAllModChannel(msg);
}
} else {
messenger.sendMessageToAllModChannel("\uD83D\uDCE2 " + msg);
}
mcb.getChatManager().getChatStatus().reset();
}
示例14: onBlockBreak
@EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
public void onBlockBreak(BlockBreakEvent event) {
double amount = event.getExpToDrop();
Player player = event.getPlayer();
ItemStack stack = player.getItemInHand();
if (stack != null && stack.getType() != Material.AIR && amount > 0) {
int enchantmentLevel = stack.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS);
if (enchantmentLevel > 0) {
double multiplier = enchantmentLevel * SettingsYML.EXP_MULTIPLIER_FORTUNE_PER_LEVEL;
int result = (int) Math.ceil(amount * multiplier);
event.setExpToDrop(result);
}
}
}
示例15: handlePlayerDamage
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void handlePlayerDamage(EntityDamageByEntityEvent event) {
if(event.getDamager() instanceof Player) {
if(((Player) event.getDamager()).getItemInHand().containsEnchantment(Enchantment.DAMAGE_ALL)) event.setDamage(1000);
} else if(event.getDamager() instanceof Arrow && ((Arrow) event.getDamager()).getShooter() instanceof Player) {
if(((Arrow) event.getDamager()).getDamage() > 2D) event.setDamage(1000);
}
}