Package net.minecraft.inventory

Examples of net.minecraft.inventory.InventoryLargeChest


    {
      for(BlockPosition bp : chestloc.getAdjacent(false))
      {
        if(world.getBlockId(bp.x, bp.y, bp.z) == Block.chest.blockID)
        {
          return new InventoryLargeChest("Large Chest", ((IInventory)te), ((IInventory)world.getBlockTileEntity(bp.x, bp.y, bp.z)));
        }
      }
    }
    return ((IInventory)te);
  }
View Full Code Here


        neighbour = chest.adjacentChestZNeg;
      } else if(chest.adjacentChestZPos != null) {
        neighbour = chest.adjacentChestZPos;
      }
      if(neighbour != null) {
        return new InventoryLargeChest("", inv, neighbour);
      }
      return inv;
    }
    return inv;
  }
View Full Code Here

    public static IInventory checkForDoubleChest(World worldObj, IInventory te, int x, int y, int z) {
      for(ForgeDirection dir : chestDirections) {
        if(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ) == Blocks.chest) {
          TileEntity otherTe = worldObj.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
          if(otherTe instanceof IInventory) {
            return new InventoryLargeChest("Large Chest", te, (IInventory)otherTe);
          }
        }
      }

      // Not a large chest, so just return the single chest.
View Full Code Here

  public static IInventory getInventory(World world, int x, int y, int z) {
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    if(tileEntity instanceof TileEntityChest) {
      Block chestBlock = world.getBlock(x, y, z);
      if(world.getBlock(x - 1, y, z) == chestBlock)
        return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x - 1, y, z), (IInventory)tileEntity);
      if(world.getBlock(x + 1, y, z) == chestBlock)
        return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x + 1, y, z));
      if(world.getBlock(x, y, z - 1) == chestBlock)
        return new InventoryLargeChest("Large chest", (IInventory)world.getTileEntity(x, y, z - 1), (IInventory)tileEntity);
      if(world.getBlock(x, y, z + 1) == chestBlock)
        return new InventoryLargeChest("Large chest", (IInventory)tileEntity, (IInventory)world.getTileEntity(x, y, z + 1));
    }
    return tileEntity instanceof IInventory ? (IInventory)tileEntity : null;
  }
View Full Code Here

        }
        else
        {
            if (theWorld.getBlockId(x - 1, y, z) == this.blockID)
            {
                chest = new InventoryLargeChest("container.chestDouble", (TileEntityColoniesChest)theWorld.getBlockTileEntity(x - 1, y, z), (IInventory)chest);
            }

            if (theWorld.getBlockId(x + 1, y, z) == this.blockID)
            {
                chest = new InventoryLargeChest("container.chestDouble", (IInventory)chest, (TileEntityColoniesChest)theWorld.getBlockTileEntity(x + 1, y, z));
            }

            if (theWorld.getBlockId(x, y, z - 1) == this.blockID)
            {
                chest = new InventoryLargeChest("container.chestDouble", (TileEntityColoniesChest)theWorld.getBlockTileEntity(x, y, z - 1), (IInventory)chest);
            }

            if (theWorld.getBlockId(x, y, z + 1) == this.blockID)
            {
                chest = new InventoryLargeChest("container.chestDouble", (IInventory)chest, (TileEntityColoniesChest)theWorld.getBlockTileEntity(x, y, z + 1));
            }

            if (theWorld.isRemote)
            {
                return true;
View Full Code Here

        adj = main.adjacentChestZPos;
      }

      if(adj != null)
      {
        return new InventoryLargeChest("", main, adj);
      }
    }

    return inv;
  }
View Full Code Here

        }
        else
        {
            if (par1World.getBlock(par2 - 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChest) par1World.getTileEntity(par2 - 1, par3, par4), (IInventory) var10);
            }

            if (par1World.getBlock(par2 + 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChest) par1World.getTileEntity(par2 + 1, par3, par4));
            }

            if (par1World.getBlock(par2, par3, par4 - 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChest) par1World.getTileEntity(par2, par3, par4 - 1), (IInventory) var10);
            }

            if (par1World.getBlock(par2, par3, par4 + 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChest) par1World.getTileEntity(par2, par3, par4 + 1));
            }

            if (par1World.isRemote)
            {
                return true;
View Full Code Here

        }
        else
        {
            if (par1World.getBlock(par2 - 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChestMars) par1World.getTileEntity(par2 - 1, par3, par4), (IInventory) var10);
            }

            if (par1World.getBlock(par2 + 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChestMars) par1World.getTileEntity(par2 + 1, par3, par4));
            }

            if (par1World.getBlock(par2, par3, par4 - 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChestMars) par1World.getTileEntity(par2, par3, par4 - 1), (IInventory) var10);
            }

            if (par1World.getBlock(par2, par3, par4 + 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChestMars) par1World.getTileEntity(par2, par3, par4 + 1));
            }

            if (par1World.isRemote)
            {
                return true;
View Full Code Here

        }
        else
        {
            if (par1World.getBlock(par2 - 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChestAsteroids) par1World.getTileEntity(par2 - 1, par3, par4), (IInventory) var10);
            }

            if (par1World.getBlock(par2 + 1, par3, par4) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChestAsteroids) par1World.getTileEntity(par2 + 1, par3, par4));
            }

            if (par1World.getBlock(par2, par3, par4 - 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (TileEntityTreasureChestAsteroids) par1World.getTileEntity(par2, par3, par4 - 1), (IInventory) var10);
            }

            if (par1World.getBlock(par2, par3, par4 + 1) == this)
            {
                var10 = new InventoryLargeChest("container.chestDouble", (IInventory) var10, (TileEntityTreasureChestAsteroids) par1World.getTileEntity(par2, par3, par4 + 1));
            }

            if (par1World.isRemote)
            {
                return true;
View Full Code Here

    public static final ForgeDirection[] chestSides = new ForgeDirection[]{ForgeDirection.WEST, ForgeDirection.EAST, ForgeDirection.NORTH, ForgeDirection.SOUTH};

    public static IInventory getChest(TileEntityChest chest) {
        for (ForgeDirection fside : chestSides) {
            if (chest.getWorldObj().getBlock(chest.xCoord + fside.offsetX, chest.yCoord + fside.offsetY, chest.zCoord + fside.offsetZ) == chest.getBlockType())
                return new InventoryLargeChest("container.chestDouble",
                        (TileEntityChest) chest.getWorldObj().getTileEntity(chest.xCoord + fside.offsetX, chest.yCoord + fside.offsetY, chest.zCoord + fside.offsetZ), chest);
        }
        return chest;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.inventory.InventoryLargeChest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.