类net.minecraft.inventory.InventoryLargeChest源码实例Demo

下面列出了怎么用net.minecraft.inventory.InventoryLargeChest的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Kettle   文件: CraftInventoryDoubleChest.java
public CraftInventoryDoubleChest(InventoryLargeChest largeChest) {
    super(largeChest);
    if (largeChest.upperChest instanceof InventoryLargeChest) {
        left = new CraftInventoryDoubleChest((InventoryLargeChest) largeChest.upperChest);
    } else {
        left = new CraftInventory(largeChest.upperChest);
    }
    if (largeChest.lowerChest instanceof InventoryLargeChest) {
        right = new CraftInventoryDoubleChest((InventoryLargeChest) largeChest.lowerChest);
    } else {
        right = new CraftInventory(largeChest.lowerChest);
    }
}
 
源代码2 项目: CodeChickenLib   文件: InventoryUtils.java
public static IInventory getChest(TileEntityChest chest) {
    for (EnumFacing fside : Plane.HORIZONTAL) {
        if (chest.getWorld().getBlockState(chest.getPos().offset(fside)).getBlock() == chest.getBlockType())
            return new InventoryLargeChest("container.chestDouble",
                    (TileEntityChest) chest.getWorld().getTileEntity(chest.getPos().offset(fside)), chest);
    }
    return chest;
}
 
源代码3 项目: BigReactors   文件: StaticUtils.java
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.
	return te;
}
 
源代码4 项目: Kettle   文件: CraftInventoryDoubleChest.java
public CraftInventoryDoubleChest(CraftInventory left, CraftInventory right) {
    super(new InventoryLargeChest("Large chest", (ILockableContainer) left.getInventory(), (ILockableContainer) right.getInventory()));
    this.left = left;
    this.right = right;
}