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


Java LivingJumpEvent类代码示例

本文整理汇总了Java中net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent的典型用法代码示例。如果您正苦于以下问题:Java LivingJumpEvent类的具体用法?Java LivingJumpEvent怎么用?Java LivingJumpEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LivingJumpEvent类属于net.minecraftforge.event.entity.living.LivingEvent包,在下文中一共展示了LivingJumpEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEntityJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event){
	EntityLivingBase ent = event.getEntityLiving();
	World world = ent.world;
	if(!world.isRemote){
		//basically, check if we are standing on placed dust, then check if its an active rune of bouncing
		BlockPos feetPos = ent.getPosition();
		IBlockState state = world.getBlockState(feetPos);
		if(state.getBlock()==WizardryRegistry.dust_placed){
			TileEntity te = world.getTileEntity(feetPos);
			if(te instanceof TileEntityDustPlaced){
				TileEntityDustPlaced ted = (TileEntityDustPlaced)te;
				RuneEntity rune = ted.getRune();
				if(rune instanceof RuneEntityBouncing){
					ent.addVelocity(0, 1D, 0);
					ent.velocityChanged=true;
				}
			}
		}
	}
}
 
开发者ID:Xilef11,项目名称:runesofwizardry-classics,代码行数:22,代码来源:RuneBouncing.java

示例2: onEntityJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event)
{
	PotionEffect effect = event.getEntityLiving().getActivePotionEffect(PotionRegistry.REDSTONE_NEEDLE);
	if (effect == null)
		return;
	if (effect.getAmplifier() >= 4)
	{
		EntityLivingBase living = event.getEntityLiving();
		living.motionX = 0;	
		living.motionY = -1;
		living.motionZ = 0;
		living.isAirBorne = false;
		living.setPosition(living.prevPosX, living.prevPosY, living.prevPosZ);
	}
}
 
开发者ID:murapix,项目名称:Inhuman-Resources,代码行数:17,代码来源:PotionRedstoneNeedle.java

示例3: PlayerJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void PlayerJump(LivingJumpEvent event)
{
   	
   	if(event.entityLiving instanceof EntityPlayer) {
   		EntityPlayer player = (EntityPlayer) event.entityLiving;
   		if(!player.isSneaking()){
		if (player.inventory.armorItemInSlot(2) != null){
			if(player.inventory.armorItemInSlot(2).getItem()== ModItems.itemBatMankini){
			player.motionY += 1.1F;
			player.addPotionEffect((new PotionEffect(Potion.moveSlowdown.getId(), 200, 1)));
			}
		}
   		}
   	}
}
 
开发者ID:MasterAbdoTGM50,项目名称:Mankini,代码行数:17,代码来源:ItemBatMankini.java

示例4: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
	
	if (event.entityLiving instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer) event.entityLiving;
		ItemStack belt = BaublesApi.getBaubles(player).getStackInSlot(0);
		
		if(belt.stackTagCompound == null){
			belt.stackTagCompound = new NBTTagCompound();
		}
		String effects = NBTHelper.getString(belt, "ETEffect");
		
		if (effects.contains("jump") && NBTHelper.getInt(stack, "energy")>0) {
			player.motionY += 0.2;
			player.fallDistance = -1;
			NBTHelper.setInteger(stack, "energy", NBTHelper.getInt(stack, "energy")-30);
		}
	}
}
 
开发者ID:jaredlll08,项目名称:Fluxed-Trinkets,代码行数:20,代码来源:ItemBeltEmpty.java

示例5: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
	if (event.entityLiving instanceof EntityPlayer) {

		EntityPlayer player = (EntityPlayer) event.entityLiving;
		ItemStack belt = BaublesApi.getBaubles(player).getStackInSlot(3);

		

		if (belt != null && belt.getItem() == this && belt.stackTagCompound.getInteger("energy") > 0) {
			if (belt.stackTagCompound == null) {
				belt.stackTagCompound = new NBTTagCompound();
			}
			player.motionY += 0.3;
			player.fallDistance = -1F;
			belt.stackTagCompound.setInteger("energy", belt.stackTagCompound.getInteger("energy") - 20);
		}
		if (belt != null && belt.getItem() == this && belt.stackTagCompound.getInteger("energy") == 0) {
			player.motionY -= 0.41999998688697815D;
		}
	}
}
 
开发者ID:jaredlll08,项目名称:Fluxed-Trinkets,代码行数:23,代码来源:ItemBeltJump.java

示例6: onLivingJumpEvent

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLivingJumpEvent(LivingJumpEvent event) {
	EntityLivingBase entityLiving = event.entityLiving;

	if (entityLiving.isSneaking()
			&& ((hasEquippedSet(entityLiving, ModArmor.windHelmet,
					ModArmor.windChest, ModArmor.windLeggings,
					ModArmor.windBoots))
					|| (hasEquippedSet(entityLiving, ModArmor.chaosHelmet,
							ModArmor.chaosChest, ModArmor.chaosLeggings,
							ModArmor.chaosBoots)) || (hasEquippedSet(
						entityLiving, ModArmor.orderHelmet,
						ModArmor.orderChest, ModArmor.orderLeggings,
						ModArmor.orderBoots)))) {
		entityLiving.motionY += 0.5;
		entityLiving.velocityChanged = true;
	}
}
 
开发者ID:testmad,项目名称:GaiaMod,代码行数:19,代码来源:GaiaModEventHandler.java

示例7: onJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onJump(LivingJumpEvent event) {
	if (event.entityLiving.getHeldItem() != null && event.entityLiving.getHeldItem().getItem() == ZSSItems.rocsFeather) {
		event.entityLiving.motionY += (event.entityLiving.isSprinting() ? 0.30D : 0.15D);
	}
	if (event.entityLiving.getEquipmentInSlot(ArmorIndex.EQUIPPED_BOOTS) != null && event.entityLiving.getEquipmentInSlot(ArmorIndex.EQUIPPED_BOOTS).getItem() == ZSSItems.bootsPegasus) {
		event.entityLiving.motionY += 0.15D;
		if (event.entity instanceof EntityPlayer) {
			ZSSPlayerInfo.get((EntityPlayer) event.entity).reduceFallAmount += 1.0F;
		}
	}
	ItemStack helm = event.entityLiving.getEquipmentInSlot(ArmorIndex.EQUIPPED_HELM);
	if (helm != null) {
		if (helm.getItem() == ZSSItems.maskBunny) {
			event.entityLiving.motionY += 0.30D;
			if (event.entity instanceof EntityPlayer) {
				ZSSPlayerInfo.get((EntityPlayer) event.entity).reduceFallAmount += 5.0F;
			}
		} else if (helm.getItem() == ZSSItems.maskDeku) {
			event.entityLiving.motionY += 0.30D;
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:24,代码来源:ZSSEntityEvents.java

示例8: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
    if (event.entityLiving instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.entityLiving;

        List<ItemStack> list = UpgradeUtil.getPlayerUpgrades(player, this);

        int energyCost = cost;

        for (ItemStack stack : list) {
            // You might not always want to jump 10 blocks high :P
            if (stack != null && EnergyUtil.getEnergyStored(stack) > energyCost && !player.isSneaking()) {
                IModularItem modularItem = (IModularItem) stack.getItem();

                (modularItem).damageArmour(stack, energyCost + 1);
                player.motionY += 1 * f.get(stack).getPercentage();

            }
        }
    }
}
 
开发者ID:chbachman,项目名称:ModularArmour,代码行数:22,代码来源:UpgradeJumpBoost.java

示例9: onLivingJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event)
{
	if (event.getEntity() == this.victim)
	{
		event.getEntity().motionY += 0.2D;
	}
}
 
开发者ID:crazysnailboy,项目名称:Halloween,代码行数:9,代码来源:EntitySlimeCurse.java

示例10: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
	
	if (!(event.getEntityLiving() instanceof EntityPlayer))
		return;
	
	EntityPlayer player = (EntityPlayer)event.getEntityLiving();
	if (player.getActivePotionEffect(MobEffects.SLOWNESS) != null && player.getActivePotionEffect(MobEffects.SLOWNESS).getAmplifier() >= 4)
		player.motionY = 0;
}
 
开发者ID:bafomdad,项目名称:uniquecrops,代码行数:11,代码来源:UCEventHandlerServer.java

示例11: onLivingJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event)
{
	if (event.getEntityLiving() != null)
	{
		if (event.getEntityLiving().isPotionActive(ExPPotions.stunned))
		{
			event.getEntityLiving().motionY -= 10;
		}
	}
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:12,代码来源:ExPHandlerServer.java

示例12: onJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onJump(LivingJumpEvent event){
	EntityLivingBase ent = event.getEntityLiving();
	if(ent instanceof EntityPlayer){
		EntityPlayer player = (EntityPlayer)ent;
		ItemStack worn = DustRegistry.getWornInscription(player);
		if(!player.isSneaking()&&DustRegistry.getInscriptionFromStack(worn)==this){
			//player.jumpMovementFactor=1.5F;
			player.addVelocity(0, 0.025, 0);
			player.velocityChanged=true;
		}
	}
}
 
开发者ID:Xilef11,项目名称:runesofwizardry-classics,代码行数:14,代码来源:InscriptionLeapII.java

示例13: jumpHeight

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void jumpHeight(LivingJumpEvent event){
	if(event.getEntityLiving() == null) return;
	ItemStack legs = event.getEntityLiving().getItemStackFromSlot(EntityEquipmentSlot.LEGS);
	if(ItemStackTools.isValid(legs)){
		if(ModEnhancements.JUMP_BOOST.isApplied(legs)){
			event.getEntityLiving().motionY +=0.21;
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:11,代码来源:ArmorEventHandler.java

示例14: onJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onJump(@Nonnull final LivingJumpEvent event) {
	if (!ModOptions.enableJumpSound)
		return;

	if (event.getEntity() == null || event.getEntity().world == null)
		return;

	if (event.getEntity().world.isRemote && EnvironState.isPlayer(event.getEntity())) {
		final BasicSound<?> sound = makeSound(Sounds.JUMP);
		SoundEffectHandler.INSTANCE.playSound(sound);
	}
}
 
开发者ID:OreCruncher,项目名称:DynamicSurroundings,代码行数:14,代码来源:PlayerActionHandler.java

示例15: onEntityJump

import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent; //导入依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingJumpEvent event)
{
	PotionEffect effect = event.getEntityLiving().getActivePotionEffect(PotionRegistry.STUN);
	if (effect == null) return;
	EntityLivingBase living = event.getEntityLiving();
	living.motionX = 0;
	living.motionY = -1;
	living.motionZ = 0;
	living.isAirBorne = false;
	living.setPosition(living.prevPosX, living.prevPosY, living.prevPosZ);
}
 
开发者ID:murapix,项目名称:Inhuman-Resources,代码行数:13,代码来源:PotionStun.java


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