public static void doDispense(
      World worldIn, ItemStack stack, int speed, EnumFacing p_82486_3_, IPosition position) {
    double var5 = position.getX();
    double var7 = position.getY();
    double var9 = position.getZ();
    if (p_82486_3_.getAxis() == EnumFacing.Axis.Y) {
      var7 -= 0.125D;
    } else {
      var7 -= 0.15625D;
    }

    EntityItem var11 = new EntityItem(worldIn, var5, var7, var9, stack);
    double var12 = worldIn.rand.nextDouble() * 0.1D + 0.2D;
    var11.motionX = (double) p_82486_3_.getFrontOffsetX() * var12;
    var11.motionY = 0.20000000298023224D;
    var11.motionZ = (double) p_82486_3_.getFrontOffsetZ() * var12;
    var11.motionX += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed;
    var11.motionY += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed;
    var11.motionZ += worldIn.rand.nextGaussian() * 0.007499999832361937D * (double) speed;
    worldIn.spawnEntityInWorld(var11);
  }
 /** Return the projectile entity spawned by this dispense behavior. */
 protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) {
   return new EntityEgg(
       par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ());
 }
Beispiel #3
0
 public static Border getBorder(IPosition pos) {
   return getBorder(pos.getX(), pos.getY());
 }