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


Java LivingEvent.LivingJumpEvent方法代码示例

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


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

示例1: stopJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void stopJump(LivingEvent.LivingJumpEvent event) {

	EntityLivingBase living=event.getEntityLiving();
	if ((living.getActivePotionEffect(TF2weapons.stun) != null && living.getActivePotionEffect(TF2weapons.bombmrs) == null)
		|| living.getActivePotionEffect(TF2weapons.charging) != null
			|| (living.getHeldItemMainhand() != null && living.getHeldItemMainhand().getItem() instanceof ItemMinigun
					&& living.hasCapability(TF2weapons.WEAPONS_CAP, null) && living.getCapability(TF2weapons.WEAPONS_CAP, null).chargeTicks > 0)) {
		living.isAirBorne = false;
		living.motionY -= 0.5f;
		if (living.isSprinting()) {
			float f = living.rotationYaw * 0.017453292F;
			living.motionX += MathHelper.sin(f) * 0.2F;
			living.motionZ -= MathHelper.cos(f) * 0.2F;
		}
	}

}
 
开发者ID:rafradek,项目名称:Mods,代码行数:19,代码来源:TF2EventsCommon.java

示例2: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
/**
 * Used for the Piston Boots to give them their amazing powers.
 *
 * @param event
 */
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event)
{
    if (event.entity != null &&
            event.entityLiving instanceof EntityPlayer)
    {
        EntityPlayer player = (EntityPlayer) event.entity;


        if (Wearing.isWearingBoots(player) && player.onGround)
        {
            ServerActions.pistonBootsJump(player);
        }
    }
}
 
开发者ID:Darkona,项目名称:AdventureBackpack2,代码行数:21,代码来源:PlayerEventHandler.java

示例3: onEntityJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onEntityJump(LivingEvent.LivingJumpEvent event)
{
	if(event.entityLiving != null && event.entityLiving instanceof EntityPlayer)
	{
		EntityPlayer player = (EntityPlayer)event.entityLiving;
		if(player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == AdvancedUtilitiesItems.runningShoes)
		{
			player.motionY+=0.05D;
		}
		if(player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == AdvancedUtilitiesItems.steamLegs)
		{
			if(player.inventory.armorItemInSlot(1).stackTagCompound != null)
			{
				NBTTagCompound tag = player.inventory.armorItemInSlot(1).stackTagCompound;
				if(tag.getInteger("tankAmount") > 0)
				{
					player.motionY+=0.05D;
				}
			}
		}
	}
}
 
开发者ID:Sudwood,项目名称:AdvancedUtilities,代码行数:24,代码来源:AUEventHandler.java

示例4: onLivingJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onLivingJump(LivingEvent.LivingJumpEvent event) {
    if (event.getEntityLiving() instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.getEntityLiving();
        PossessivePlayer possessivePlayer = PossessHandler.get(player);
        if (possessivePlayer != null) {
            for (EntityPossessHandler handler : PossessHandler.getPossessHandlers(possessivePlayer.getPossessing())) {
                handler.onJump(possessivePlayer, player);
            }
        }
    }
}
 
开发者ID:Fararise,项目名称:Possessed,代码行数:13,代码来源:ServerEventHandler.java

示例5: jump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void jump(LivingEvent.LivingJumpEvent event) {
	EntityLivingBase entity = event.getEntityLiving();
	if (!entity.isPotionActive(this)) return;

	PotionEffect effect = entity.getActivePotionEffect(this);
	if (effect == null) return;

	entity.motionY = effect.getAmplifier() / 3.0;
}
 
开发者ID:TeamWizardry,项目名称:Wizardry,代码行数:11,代码来源:PotionLowGrav.java

示例6: jump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void jump(LivingEvent.LivingJumpEvent event)
{
	if(!shouldCancelled(event.entityLiving))
	{
		return;
	}

	if(event.entityLiving.motionY >= 0)
	{
		event.entityLiving.motionY *= 4;
	}
}
 
开发者ID:a1lic,项目名称:McMod-CheatStar,代码行数:14,代码来源:EventItemSuperStar.java

示例7: onPlayerJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onPlayerJump(LivingEvent.LivingJumpEvent event) {
    if (event.entityLiving instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.entityLiving;
        boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;

        if (hasArmor)
            player.motionY += jumpBonus;
    }
}
 
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:11,代码来源:ItemElectricBootsTraveller.java

示例8: LivingJumpEvent

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void LivingJumpEvent(LivingEvent.LivingJumpEvent event){
    if (event.entityLiving instanceof EntityPlayerMP) {
        EntityPlayerMP player = (EntityPlayerMP) event.entityLiving;
        if (Skills.LegStrength > 5 && Skills.LegStrength < 50) {
            double JumpBuff = (0.1 * (Skills.LegStrength / 10));
            player.motionY += JumpBuff;
        }
    }
}
 
开发者ID:HxCKDMS,项目名称:HxCSkills,代码行数:11,代码来源:EventsHandler.java

示例9: makeJumpHigher

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@EventHandler
public void makeJumpHigher(LivingEvent.LivingJumpEvent event) {
    event.entity.motionY *= 5;
    DCHLog.warning("set new id superjump");
}
 
开发者ID:digital-crafting-habitat,项目名称:dch_hack1ng_d4ys_workshop,代码行数:6,代码来源:DigitalCraftingHabitatMod.java

示例10: printJump

import net.minecraftforge.event.entity.living.LivingEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void printJump(LivingEvent.LivingJumpEvent event) {
	System.out.println("jump");
}
 
开发者ID:TheDarkEra,项目名称:TheDarkEra,代码行数:5,代码来源:WorldGenHandler.java


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