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


Java EventPriority.HIGH属性代码示例

本文整理汇总了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));
			}
		}
	}
}
 
开发者ID:cqjjjzr,项目名称:NoteblockTweak,代码行数:12,代码来源:NoteblockPlaceHandler.java

示例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);
	}
}
 
开发者ID:UnderMybrella,项目名称:Fidelis,代码行数:12,代码来源:Fidelis.java

示例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);
    }
}
 
开发者ID:makeoo,项目名称:Gadomancy,代码行数:12,代码来源:EventHandlerWorld.java

示例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);
	}
}
 
开发者ID:Wuerfel21,项目名称:The-Derpy-Shiz-Mod,代码行数:7,代码来源:DerpyEvents.java

示例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);
		}

	}
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:14,代码来源:TerminalManagerServer.java

示例6: GuiOpenEvent

@SubscribeEvent(priority = EventPriority.HIGH)
public void GuiOpenEvent(GuiOpenEvent event) {
}
 
开发者ID:Dragon9815,项目名称:PlayerInterfaceMod,代码行数:3,代码来源:GuiEventHandler.java

示例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);
}
 
开发者ID:copygirl,项目名称:AdvHealthOptions,代码行数:5,代码来源:CommonProxy.java


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