当前位置: 首页>>代码示例>>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;未经允许,请勿转载。