當前位置: 首頁>>代碼示例>>Java>>正文


Java EventPriority.TOP屬性代碼示例

本文整理匯總了Java中net.minecraftforge.fml.common.eventhandler.EventPriority.TOP屬性的典型用法代碼示例。如果您正苦於以下問題:Java EventPriority.TOP屬性的具體用法?Java EventPriority.TOP怎麽用?Java EventPriority.TOP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在net.minecraftforge.fml.common.eventhandler.EventPriority的用法示例。


在下文中一共展示了EventPriority.TOP屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPopulateChunk_Populate

@SubscribeEvent(priority = EventPriority.TOP)
public static void onPopulateChunk_Populate(PopulateChunkEvent.Populate event) {
	Biome biome = event.getWorld().getBiome(new BlockPos(event.getChunkX() * 16, 1, event.getChunkZ() * 16));
	if (biome instanceof AlchemyBiome) {
		if (event.getType() == PopulateChunkEvent.Populate.EventType.LAKE ||
			event.getType() == PopulateChunkEvent.Populate.EventType.LAVA)
				AlchemyEventSystem.markEventIgnore(event, Result.DENY);
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:9,代碼來源:AlchemyBiome.java

示例2: onRenderLiving_Pre

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.TOP)
public void onRenderLiving_Pre(RenderLivingEvent.Pre<EntityLivingBase> event) {
	if (last == event.getEntity())
		return;
	Minecraft minecraft = Minecraft.getMinecraft();
	EntityPlayer player = minecraft.player;
	EntityLivingBase living = event.getEntity();
	int id = living.getEntityData().getInteger(NBT_KEY_RENDER);
	if (id != 0) {
		AlchemyEventSystem.markEventCanceled(event);
		last = AlchemyEntityManager.getEntityById(AlchemyEntityManager.FRIENDLY_LIVING_LIST, id, minecraft.world);
		float partialTick = minecraft.getRenderPartialTicks();
		double lx = living.lastTickPosX + (living.posX - living.lastTickPosX) * partialTick;
		double ly = living.lastTickPosY + (living.posY - living.lastTickPosY) * partialTick;
		double lz = living.lastTickPosZ + (living.posZ - living.lastTickPosZ) * partialTick;
		double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTick;
		double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTick;
		double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTick;
		float f = living.prevRotationYaw + (living.rotationYaw - living.prevRotationYaw) * partialTick;
		glPushMatrix();
		glTranslated(lx - px, ly - py, lz - pz);
		glRotatef(-f % 360, 0, 1, 0);
		RenderHelper.renderEntity(last, partialTick);
		glPopMatrix();
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:27,代碼來源:PotionWitchcraft.java

示例3: onLivingSetAttackTarget

@SubscribeEvent(priority = EventPriority.TOP)
public void onLivingSetAttackTarget(LivingSetAttackTargetEvent event) {
	if (event.getEntityLiving().isPotionActive(this) && event.getEntityLiving() instanceof EntityLiving) {
		((EntityLiving) event.getEntityLiving()).attackTarget = null;
		AlchemyEventSystem.markEventIgnore(event);
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:7,代碼來源:PotionWitchcraft.java

示例4: onLivingSetAttackTarget

@SubscribeEvent(priority = EventPriority.TOP)
public void onLivingSetAttackTarget(LivingSetAttackTargetEvent event) {
	if (event.getEntityLiving() instanceof EntityLiving && event.getEntityLiving().isNonBoss()
		&& event.getTarget() != null && event.getTarget().isPotionActive(this)
		&& event.getEntityLiving().getCombatTracker().getBestAttacker() != event.getTarget()) {
		EntityLiving living = (EntityLiving) event.getEntityLiving();
		Class<EntityLivingBase> type = (Class<EntityLivingBase>) 
				(event.getEntityLiving() instanceof EntityPlayer ? EntityPlayer.class : event.getEntityLiving().getClass());
		living.attackTarget = EntityAIFindEntityNearestHelper.<EntityLivingBase>findNearest(
				living.attackTarget, type, null, NOT_ACTIVE
				.and(l -> EntityAIFindEntityNearestHelper.isSuitableLivingTarget(living, l)));
		AlchemyEventSystem.markEventIgnore(event);
	}
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:14,代碼來源:PotionElapse.java

示例5: onKeyInput

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.TOP)
public static void onKeyInput(KeyInputEvent event) {
	if (isHookInput())
		KeyBinding.unPressAllKeys();
	for (KeyBindingHandle handle : key_handle)
			if (isKeyHandleActive(handle))
				handle.handle();
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:9,代碼來源:AlchemyEventSystem.java

示例6: onDecorateBiome_Decorate

@SubscribeEvent(priority = EventPriority.TOP)
public static void onDecorateBiome_Decorate(DecorateBiomeEvent.Decorate event) {
	if (event.getWorld().getBiome(event.getPos()) instanceof AlchemyBiome)
		AlchemyEventSystem.markEventIgnore(event, Result.DENY);
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:5,代碼來源:AlchemyBiome.java

示例7: onMouseInput

@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.TOP)
public static void onMouseInput(MouseEvent event) {
	if (isHookInput())
		markEventCanceled(event);
}
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:6,代碼來源:AlchemyEventSystem.java


注:本文中的net.minecraftforge.fml.common.eventhandler.EventPriority.TOP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。