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); }
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; }
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(); }
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--; } } }
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--; } } }
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); }
public override void hitEntity(ItemStack itemstack, EntityLiving entityliving) { itemstack.damageItem(1); }
public void useItemOnEntity(EntityLiving entityliving) { Item.itemsList[itemID].saddleEntity(this, entityliving); }
public virtual void hitEntity(EntityLiving entityliving) { Item.itemsList[itemID].hitEntity(this, entityliving); }
public override void hitEntity(ItemStack itemstack, EntityLiving entityliving) { saddleEntity(itemstack, entityliving); }
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)); } }
public virtual void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving) { }
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); } }
public virtual void saddleEntity(ItemStack itemstack, EntityLiving entityliving) { }
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); } }