本文整理汇总了Java中cpw.mods.fml.common.eventhandler.EventPriority.HIGH属性的典型用法代码示例。如果您正苦于以下问题:Java EventPriority.HIGH属性的具体用法?Java EventPriority.HIGH怎么用?Java EventPriority.HIGH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cpw.mods.fml.common.eventhandler.EventPriority
的用法示例。
在下文中一共展示了EventPriority.HIGH属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rightClick
@SubscribeEvent(priority = EventPriority.HIGH)
public void rightClick(PlayerInteractEvent event){
if(event.entityPlayer.getHeldItem() != null && event.entityPlayer.getHeldItem().getItem() instanceof ItemNoteblockFork){
if(Minecraft.getMinecraft().theWorld.getBlock(event.x, event.y, event.z) instanceof BlockNote){
if(!event.entityPlayer.isSneaking()){
event.setCanceled(true);
TileEntityNote entity = (TileEntityNote) Minecraft.getMinecraft().theWorld.getTileEntity(event.x, event.y, event.z);
Minecraft.getMinecraft().displayGuiScreen(new GuiSet(entity, Minecraft.getMinecraft().currentScreen));
}
}
}
}
示例2: onDeath
@SubscribeEvent(priority = EventPriority.HIGH)
public void onDeath(LivingDeathEvent event){
if(event.entityLiving instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) event.entityLiving;
ItemStack[] mainInv = getSoulboundItems(getID(player), player.inventory.mainInventory);
ItemStack[] armorInv = getSoulboundItems(getID(player), player.inventory.armorInventory);
setFidelisNBT(player, MAIN, setItems(mainInv));
setFidelisNBT(player, ARMOR, setItems(armorInv));
if(BAUBLES_LOADED)
BaubleLoyalty.onDeath(player);
}
}
示例3: on
@SubscribeEvent(priority = EventPriority.HIGH)
public void on(ExplosionEvent.Start e) {
Explosion expl = e.explosion;
if(expl.isSmoking
&& (expl.exploder != null ? TileBlockProtector.isSpotProtected(e.world, expl.exploder) :
TileBlockProtector.isSpotProtected(e.world, expl.explosionX, expl.explosionY, expl.explosionZ))) {
//why?
//expl.isSmoking = false;
e.setCanceled(true);
e.world.newExplosion(expl.exploder, expl.explosionX, expl.explosionY, expl.explosionZ, expl.explosionSize, expl.isFlaming, false);
}
}
示例4: onLivingHurt
@SubscribeEvent(priority = EventPriority.HIGH)
public void onLivingHurt(LivingHurtEvent event) {
if (event.source.damageType == "fall" && event.entityLiving instanceof EntityPlayer && ((EntityPlayer) event.entityLiving).isBlocking() && ((EntityPlayer) event.entityLiving).getHeldItem() != null && ((EntityPlayer) event.entityLiving).getHeldItem().getItem() instanceof WindSword) {
event.setCanceled(true);
DerpyItems.damageItem(((EntityPlayer) event.entityLiving).getHeldItem(), 1, event.entityLiving);
}
}
示例5: onServerChatEvent
@SubscribeEvent(priority = EventPriority.HIGH)
public void onServerChatEvent(ServerChatEvent event) {
final EntityPlayerMP player = event.player;
final Optional<Long> guid = TerminalIdAccess.instance.getIdFrom(player);
if (guid.isPresent()) {
if (event.message.startsWith("$$")) {
sendChatEvent(EVENT_CHAT_COMMAND, player, guid.get(), event.message.substring(2).trim());
event.setCanceled(true);
} else if (Config.listenToAllChat) {
sendChatEvent(EVENT_CHAT_MESSAGE, player, guid.get(), event.message);
}
}
}
示例6: GuiOpenEvent
@SubscribeEvent(priority = EventPriority.HIGH)
public void GuiOpenEvent(GuiOpenEvent event) {
}
示例7: onLivingHurt
@SubscribeEvent(priority = EventPriority.HIGH)
public void onLivingHurt(LivingHurtEvent event) {
if (event.entity instanceof EntityPlayerMP)
event.ammount = (float)getProperties(event.entity).hurt((EntityPlayer)event.entity, event.ammount, event.source);
}