Java 类net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent 实例源码

项目:runesofwizardry-classics    文件:RuneBouncing.java   
@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;
                }
            }
        }
    }
}
项目:Inhuman-Resources    文件:PotionRedstoneNeedle.java   
@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);
    }
}
项目:Mankini    文件:ItemBatMankini.java   
@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)));
            }
        }
        }
    }
}
项目:Mankini    文件:BatMankiniJump.java   
@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)));
            }
        }
        }
    }
}
项目:Fluxed-Trinkets    文件:ItemBeltEmpty.java   
@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);
        }
    }
}
项目:Fluxed-Trinkets    文件:ItemBeltJump.java   
@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;
        }
    }
}
项目:GaiaMod    文件:GaiaModEventHandler.java   
@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;
    }
}
项目:ZeldaSwordSkills    文件:ZSSEntityEvents.java   
@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;
        }
    }
}
项目:ModularArmour    文件:UpgradeJumpBoost.java   
@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();

            }
        }
    }
}
项目:Halloween    文件:EntitySlimeCurse.java   
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event)
{
    if (event.getEntity() == this.victim)
    {
        event.getEntity().motionY += 0.2D;
    }
}
项目:uniquecrops    文件:UCEventHandlerServer.java   
@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;
}
项目:ExPetrum    文件:ExPHandlerServer.java   
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event)
{
    if (event.getEntityLiving() != null)
    {
        if (event.getEntityLiving().isPotionActive(ExPPotions.stunned))
        {
            event.getEntityLiving().motionY -= 10;
        }
    }
}
项目:runesofwizardry-classics    文件:InscriptionLeapII.java   
@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;
        }
    }
}
项目:CrystalMod    文件:ArmorEventHandler.java   
@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;
        }
    }
}
项目:DynamicSurroundings    文件:PlayerActionHandler.java   
@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);
    }
}
项目:Inhuman-Resources    文件:PotionStun.java   
@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);
}
项目:ARKCraft    文件:PlayerCommonEventHandler.java   
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event)
{
    if (event.getEntityLiving() instanceof EntityPlayer) {
        EntityPlayer p = (EntityPlayer) event.getEntityLiving();
        if (WeightsConfig.isEnabled && (!p.capabilities.isCreativeMode || WeightsConfig.allowInCreative) && ARKPlayer.get(p).isEncumbered()) {
            p.motionY *= 0;
            if (p.world.isRemote)
                p.sendMessage(new TextComponentTranslation("ark.splash.noJump"));

        }
    }
}
项目:Coding    文件:DragonPlayerEventHandler.java   
@SubscribeEvent
public void onLivingJump(LivingJumpEvent event) {
    if (event.entity instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.entity;
        if (DragonPlayer.get(player).isDragon() && ItemDragonEgg.hasAbility(player, Abilities.FIREDRAGON)) {
            PlayerModifiers.addJumpBoost(DragonPlayer.get(player).getLevel(), player);
        }
    }
}
项目:Kingdom-Keys-Re-Coded    文件:EntityEvents.java   
@SubscribeEvent
public void onJump (LivingJumpEvent event) {
    if (event.getEntityLiving() instanceof EntityPlayer) {
        EntityPlayer player = (EntityPlayer) event.getEntityLiving();
        if(player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue() == 0){
            player.motionY=-0.0001;
        }
    }
}
项目:CubesEdge    文件:MovementRoll.java   
@SubscribeEvent
public void jump(LivingJumpEvent event) {
    if (event.entityLiving instanceof EntityPlayer
            && ((EntityPlayerCustom)event.entityLiving.getExtendedProperties("Cube's Edge Player")).isRolling) {
        event.entityLiving.motionY = 0;
    }
}
项目:CubesEdge    文件:MovementJump.java   
@SubscribeEvent
public void jump(LivingJumpEvent event) {
    // if(event.entityLiving instanceof EntityPlayer &&
    // ((EntityPlayerCustom)event.entityLiving.getExtendedProperties("Cube's Edge Player")).isJumping
    // != 0){
    // event.entityLiving.motionY = 0;
    // }
}
项目:CubesEdge    文件:MovementSlide.java   
@SubscribeEvent
public void jump(LivingJumpEvent event) {
    if (event.entityLiving instanceof EntityPlayer
            && ((EntityPlayerCustom)event.entityLiving.getExtendedProperties("Cube's Edge Player")).isSneaking) {
        event.entityLiving.motionY = 0;
    }
}
项目:MysticalTrinkets    文件:ItemJumpingBelt.java   
@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) {
            player.motionY += 0.3;
            player.fallDistance = -1F;
        }
    }
}
项目:IceAndShadow2    文件:NyxBlockHandler.java   
@SubscribeEvent
public void onTryToStartClimbingOrSomething(LivingJumpEvent e) {
    if (e.entityLiving instanceof EntityPlayer && e.entityLiving.isSneaking()) {
        final World w = e.entityLiving.worldObj;
        final int x = (int) (e.entityLiving.posX - (e.entityLiving.posX < 0 ? 1 : 0));
        final int y = (int) (e.entityLiving.posY);
        final int z = (int) (e.entityLiving.posZ - (e.entityLiving.posZ < 0 ? 1 : 0));
        for (final ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
            if (w.getBlock(x + dir.offsetX, y, z + dir.offsetZ) instanceof IIaSBlockClimbable) {
                IaSBaseBlockAirlike.makeClimbable(w, x, y, z);
                IaSBaseBlockAirlike.makeClimbable(w, x, y + 1, z);
                break;
            }
    }
}
项目:OpenBlocks    文件:ExplosiveEnchantmentsHandler.java   
@SubscribeEvent
public void onJump(LivingJumpEvent e) {
    final Entity entity = e.getEntity();
    JumpInfo boost = jumpBoosts.remove(entity);
    if (boost != null) {
        boost.modifyVelocity(entity);

        if (OpenMods.proxy.isClientPlayer(entity)) {
            KeyBinding.setKeyBindState(Minecraft.getMinecraft().gameSettings.keyBindJump.getKeyCode(), false);
        }
    }
}
项目:CustomWorldGen    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:TRHS_Club_Mod_2016    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:CauldronGit    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:Cauldron    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:Cauldron    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:Cauldron    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:RuneCraftery    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:RuneCraftery    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:BetterNutritionMod    文件:ForgeHooks.java   
public static void onLivingJump(EntityLivingBase entity)
{
    MinecraftForge.EVENT_BUS.post(new LivingJumpEvent(entity));
}
项目:FallingEarth    文件:ArmorAbilityHandler.java   
@ForgeSubscribe
public void onLivingJumpEvent(LivingJumpEvent e)
{
    if (e.entityLiving instanceof EntityPlayer)
    {
        EntityPlayer var5 = (EntityPlayer)e.entityLiving;
        ItemStack boots = var5.inventory.armorInventory[0];
        ItemStack legs = var5.inventory.armorInventory[1];
        ItemStack chest = var5.inventory.armorInventory[2];
        ItemStack helm = var5.inventory.armorInventory[3];
        int bootID = 0;
        int chestID = 0;
        int legID = 0;
        int helmID = 0;
        if (boots != null)
            bootID = boots.itemID;
        else
            return;

        if (chest != null)
            chestID = chest.itemID;
        else
            return;

        if (legs != null)
            legID = legs.itemID;
        else
            return;

        if (helm != null)
            helmID = helm.itemID;
        else
            return;


        if (bootID == ItemHelper.meteoriticBoots.itemID
                && legID == ItemHelper.meteoriticLegs.itemID
                && chestID == ItemHelper.meteoriticBody.itemID
                && helmID == ItemHelper.meteoriticHead.itemID)
        {
            var5.addVelocity(0, 0.3D, 0);
        }
    }
   }
项目:ShadowsOfPhysis    文件:IEventGear.java   
public void onUserJump(LivingJumpEvent event, ItemStack stack);