Exemplo n.º 1
0
 public EntitySnowball(World world, EntityLiving entityliving)
     : base(world)
 {
     xTileSnowball = -1;
     yTileSnowball = -1;
     zTileSnowball = -1;
     inTileSnowball = 0;
     inGroundSnowball = false;
     shakeSnowball = 0;
     ticksInAir = 0;
     owner = entityliving;
     setSize(0.25F, 0.25F);
     setLocationAndAngles(entityliving.posX, entityliving.posY + entityliving.getEyeHeight(),
                          entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch);
     posX -= MathHelper.cos((rotationYaw/180F)*3.141593F)*0.16F;
     posY -= 0.10000000149011612D;
     posZ -= MathHelper.sin((rotationYaw/180F)*3.141593F)*0.16F;
     setPosition(posX, posY, posZ);
     yOffset = 0.0F;
     float f = 0.4F;
     motionX = -MathHelper.sin((rotationYaw/180F)*3.141593F)*MathHelper.cos((rotationPitch/180F)*3.141593F)*f;
     motionZ = MathHelper.cos((rotationYaw/180F)*3.141593F)*MathHelper.cos((rotationPitch/180F)*3.141593F)*f;
     motionY = -MathHelper.sin((rotationPitch/180F)*3.141593F)*f;
     func_6141_a(motionX, motionY, motionZ, 1.5F, 1.0F);
 }
Exemplo n.º 2
0
 public EntityFireball(World world, EntityLiving entityliving, double d, double d1, double d2)
     : base(world)
 {
     xTile = -1;
     yTile = -1;
     zTile = -1;
     inTile = 0;
     inGround = false;
     shake = 0;
     ticksInAir = 0;
     owner = entityliving;
     setSize(1.0F, 1.0F);
     setLocationAndAngles(entityliving.posX, entityliving.posY, entityliving.posZ, entityliving.rotationYaw,
                          entityliving.rotationPitch);
     setPosition(posX, posY, posZ);
     yOffset = 0.0F;
     motionX = motionY = motionZ = 0.0D;
     d += rand.nextGaussian()*0.40000000000000002D;
     d1 += rand.nextGaussian()*0.40000000000000002D;
     d2 += rand.nextGaussian()*0.40000000000000002D;
     double d3 = MathHelper.sqrt_double(d*d + d1*d1 + d2*d2);
     field_9199_b = (d/d3)*0.10000000000000001D;
     field_9198_c = (d1/d3)*0.10000000000000001D;
     field_9196_d = (d2/d3)*0.10000000000000001D;
 }
Exemplo n.º 3
0
 public Packet24MobSpawn(EntityLiving entityliving)
 {
     entityId = entityliving.entityId;
     type = (byte) EntityList.getEntityID(entityliving);
     xPosition = MathHelper.floor_double(entityliving.posX*32D);
     yPosition = MathHelper.floor_double(entityliving.posY*32D);
     zPosition = MathHelper.floor_double(entityliving.posZ*32D);
     yaw = (byte) (int) ((entityliving.rotationYaw*256F)/360F);
     pitch = (byte) (int) ((entityliving.rotationPitch*256F)/360F);
     metaData = entityliving.getDataWatcher();
 }
Exemplo n.º 4
0
 public override void saddleEntity(ItemStack itemstack, EntityLiving entityliving)
 {
     if (entityliving is EntityPig)
     {
         var entitypig = (EntityPig) entityliving;
         if (!entitypig.func_21065_K())
         {
             entitypig.func_21064_a(true);
             itemstack.stackSize--;
         }
     }
 }
Exemplo n.º 5
0
 public override void saddleEntity(ItemStack itemstack, EntityLiving entityliving)
 {
     if (entityliving is EntitySheep)
     {
         var entitysheep = (EntitySheep) entityliving;
         int i = BlockCloth.func_21033_c(itemstack.getItemDamage());
         if (!entitysheep.func_21069_f_() && entitysheep.getFleeceColor() != i)
         {
             entitysheep.setFleeceColor(i);
             itemstack.stackSize--;
         }
     }
 }
Exemplo n.º 6
0
 public EntityArrow(World world, EntityLiving entityliving)
     : base(world)
 {
     xTile = -1;
     yTile = -1;
     zTile = -1;
     inTile = 0;
     inGround = false;
     arrowShake = 0;
     ticksInAir = 0;
     owner = entityliving;
     setSize(0.5F, 0.5F);
     setLocationAndAngles(entityliving.posX, entityliving.posY + entityliving.getEyeHeight(),
                          entityliving.posZ, entityliving.rotationYaw, entityliving.rotationPitch);
     posX -= MathHelper.cos((rotationYaw/180F)*3.141593F)*0.16F;
     posY -= 0.10000000149011612D;
     posZ -= MathHelper.sin((rotationYaw/180F)*3.141593F)*0.16F;
     setPosition(posX, posY, posZ);
     yOffset = 0.0F;
     motionX = -MathHelper.sin((rotationYaw/180F)*3.141593F)*MathHelper.cos((rotationPitch/180F)*3.141593F);
     motionZ = MathHelper.cos((rotationYaw/180F)*3.141593F)*MathHelper.cos((rotationPitch/180F)*3.141593F);
     motionY = -MathHelper.sin((rotationPitch/180F)*3.141593F);
     setArrowHeading(motionX, motionY, motionZ, 1.5F, 1.0F);
 }
Exemplo n.º 7
0
 public override void hitEntity(ItemStack itemstack, EntityLiving entityliving)
 {
     itemstack.damageItem(1);
 }
Exemplo n.º 8
0
 public void useItemOnEntity(EntityLiving entityliving)
 {
     Item.itemsList[itemID].saddleEntity(this, entityliving);
 }
Exemplo n.º 9
0
 public virtual void hitEntity(EntityLiving entityliving)
 {
     Item.itemsList[itemID].hitEntity(this, entityliving);
 }
Exemplo n.º 10
0
 public override void hitEntity(ItemStack itemstack, EntityLiving entityliving)
 {
     saddleEntity(itemstack, entityliving);
 }
Exemplo n.º 11
0
 private static void func_21166_a(EntityLiving entityliving, World world, float f, float f1, float f2)
 {
     if ((entityliving is EntitySpider) && world.rand.nextInt(100) == 0)
     {
         var entityskeleton = new EntitySkeleton(world);
         entityskeleton.setLocationAndAngles(f, f1, f2, entityliving.rotationYaw, 0.0F);
         world.entityJoinedWorld(entityskeleton);
         entityskeleton.mountEntity(entityliving);
     }
     else if (entityliving is EntitySheep)
     {
         ((EntitySheep) entityliving).setFleeceColor(EntitySheep.func_21066_a(world.rand));
     }
 }
Exemplo n.º 12
0
 public virtual void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
 {
 }
Exemplo n.º 13
0
 public override void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
 {
     int l = MathHelper.floor_double(((entityliving.rotationYaw*4F)/360F) + 0.5D) & 3;
     if (l == 0)
     {
         world.setBlockMetadataWithNotify(i, j, k, 2);
     }
     if (l == 1)
     {
         world.setBlockMetadataWithNotify(i, j, k, 1);
     }
     if (l == 2)
     {
         world.setBlockMetadataWithNotify(i, j, k, 3);
     }
     if (l == 3)
     {
         world.setBlockMetadataWithNotify(i, j, k, 0);
     }
 }
Exemplo n.º 14
0
 public virtual void saddleEntity(ItemStack itemstack, EntityLiving entityliving)
 {
 }
Exemplo n.º 15
0
 public override void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
 {
     int l = ((MathHelper.floor_double(((entityliving.rotationYaw*4F)/360F) + 0.5D) & 3) + 2)%4;
     world.setBlockMetadataWithNotify(i, j, k, l);
     bool flag = func_22012_g(world, i, j, k, l);
     if (flag)
     {
         world.func_22074_c(i, j, k, blockID, 1);
     }
 }