Package net.minecraft.entity.passive

Examples of net.minecraft.entity.passive.EntityHorse


          IInventory inv = (IInventory) e;
          if(scanInventory(inv, pstack))
            positionsBuilder.append(e.getEntityId()).append(";");

        } else if(e instanceof EntityHorse) {
          EntityHorse horse = (EntityHorse) e;
          AnimalChest chest = ReflectionHelper.getPrivateValue(EntityHorse.class, horse, LibObfuscation.HORSE_CHEST);
          if(scanInventory(chest, pstack))
            positionsBuilder.append(horse.getEntityId()).append(";");

        } else if(e instanceof EntityPlayer) {
          EntityPlayer player_ = (EntityPlayer) e;
          InventoryPlayer inv = player_.inventory;
          InventoryBaubles binv = PlayerHandler.getPlayerBaubles(player_);
View Full Code Here


  }

  @Override
  public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) {
    if(par3EntityLivingBase instanceof EntityHorse) {
      EntityHorse horse = (EntityHorse) par3EntityLivingBase;
      if(horse.getHorseType() != 3 && horse.getHorseType() != 4 && horse.isTame()) {
        horse.setHorseType(3 + par1ItemStack.getItemDamage());
        BaseAttributeMap attributes = horse.getAttributeMap();
        IAttributeInstance movementSpeed = attributes.getAttributeInstance(SharedMonsterAttributes.movementSpeed);
        IAttributeInstance health = attributes.getAttributeInstance(SharedMonsterAttributes.maxHealth);
        health.applyModifier(new AttributeModifier("Ermergerd Virus D:", health.getBaseValue(), 0));
        movementSpeed.applyModifier(new AttributeModifier("Ermergerd Virus D:", movementSpeed.getBaseValue(), 0));
        IAttributeInstance jumpHeight = attributes.getAttributeInstance(ReflectionHelper.<IAttribute, EntityHorse>getPrivateValue(EntityHorse.class, null, LibObfuscation.HORSE_JUMP_STRENGTH));
View Full Code Here

    EntityLivingBase entity = event.entityLiving;
    if(entity.ridingEntity != null && entity.ridingEntity instanceof EntityLivingBase)
      entity = (EntityLivingBase) entity.ridingEntity;

    if(entity instanceof EntityHorse && event.source == DamageSource.fall) {
      EntityHorse horse = (EntityHorse) entity;
      if((horse.getHorseType() == 3 || horse.getHorseType() == 4) && horse.isTame())
        event.setCanceled(true);
    }
  }
View Full Code Here

      setValue("bred", false);
     
      return;
    }
   
    EntityHorse ride = (EntityHorse) xride;
   
    //setValue("jumping", ride.isHorseJumping()); // not functionnal
    setValue("rearing", ride.isRearing());
    setValue("saddled", ride.isHorseSaddled());
    setValue("leashed", ride.getLeashed());
    setValue("chested", ride.isChested());
    setValue("tame", ride.isTame());
   
    setValue("type", ride.getHorseType());
    setValue("variant", ride.getHorseVariant());
   
    setValue("name_tag", ride.getCustomNameTag());
   
    setValue("health1k", (int) (ride.getHealth() * 1000));
    setValue("leashed_to_player", ride.getLeashed() && ride.getLeashedToEntity() instanceof EntityPlayer);
    setValue(
      "ridden_by_owner",
      ride.riddenByEntity instanceof EntityPlayer
        && !ride.func_152119_ch().equals("")
        && ride.func_152119_ch().equals(((EntityPlayer) ride.riddenByEntity).getGameProfile().getId()));
    setValue(
      "leashed_to_owner",
      ride.getLeashedToEntity() instanceof EntityPlayer
        && !ride.func_152119_ch().equals("")
        && ride.func_152119_ch().equals(((EntityPlayer) ride.getLeashedToEntity()).getGameProfile().getId()));
   
    if (ride.getLeashed() && ride.getLeashedToEntity() != null)
    {
      Entity e = ride.getLeashedToEntity();
      setValue("leash_distance", (int) (e.getDistanceToEntity(ride) * 1000));
    }
    else
    {
      setValue("leash_distance", 0);
    }
   
    // Server only?
    setValue("temper", ride.getTemper());
    setValue("owner_uuid", ride.func_152119_ch());
    setValue("reproduced", ride.getHasReproduced());
    setValue("bred", ride.func_110205_ce());
  }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.passive.EntityHorse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.