private boolean chestCheck(ItemStack is) { TileEntity te = worldObj.getTileEntity(xCoord, yCoord - 1, zCoord); if (te instanceof IInventory) { IInventory ii = (IInventory) te; if (ReikaInventoryHelper.addToIInv(is, ii)) return true; } return false; }
private void dropItems(World world, int x, int y, int z, Collection<ItemStack> li) { for (ItemStack is : li) { boolean flag = true; for (int i = 0; i < 6 && flag; i++) { TileEntity te = this.getAdjacentTileEntity(dirs[i]); if (te instanceof IInventory) { if (ReikaInventoryHelper.addToIInv(is, (IInventory) te)) flag = false; } } if (flag) { ReikaItemHelper.dropItem(world, x + 0.5, y + 1.5, z + 0.5, is); dropFlag = true; this.doDropWarning(world, x, y, z); } } }
private boolean chestCheck(World world, int x, int y, int z, ItemStack is) { if (is == null) return false; if (world.isRemote) return false; for (int i = 0; i < 6; i++) { ForgeDirection dir = dirs[i]; TileEntity te = this.getAdjacentTileEntity(dir); if (te instanceof IInventory) { boolean flag = true; if (te instanceof PartialInventory) { if (!((PartialInventory) te).hasInventory()) flag = false; } if (flag) { if (ReikaInventoryHelper.addToIInv(is, (IInventory) te)) return true; } } } return false; }