當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。