protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
   EnumFacing var3 = BlockDispenser.getFacing(source.getBlockMetadata());
   IPosition var4 = BlockDispenser.getDispensePosition(source);
   ItemStack var5 = stack.splitStack(1);
   doDispense(source.getWorld(), var5, 6, var3, var4);
   return stack;
 }
Beispiel #2
0
 public ItemStack dispenseItem(ItemStack it, boolean sim) {
   ForgeDirection side = getSideFacing();
   TileEntity te =
       worldObj.getTileEntity(xCoord + side.offsetX, yCoord + side.offsetY, zCoord + side.offsetZ);
   if (te != null && te instanceof IInventory) {
     ItemStack rem = ItemUtil.addItemToNearbyInventories(this, it, false, sim, side);
     return rem;
   } else {
     if (!sim) {
       BlockSourceImpl impl = new BlockSourceImpl(worldObj, xCoord, yCoord, zCoord);
       BehaviorDefaultDispenseItem.doDispense(
           worldObj,
           it,
           6,
           BlockDispenser.func_149937_b(worldObj.getBlockMetadata(xCoord, yCoord, zCoord)),
           BlockDispenser.func_149939_a(impl));
     }
     return null;
   }
 }