Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
DoubleChest.java
1 package org.bukkit.block;
2 
3 import org.bukkit.Location;
4 import org.bukkit.World;
8 
9 /**
10  * Represents a double chest.
11  */
12 public class DoubleChest implements InventoryHolder {
13  private DoubleChestInventory inventory;
14 
15  public DoubleChest(DoubleChestInventory chest) {
16  inventory = chest;
17  }
18 
20  return inventory;
21  }
22 
23  public InventoryHolder getLeftSide() {
24  return inventory.getLeftSide().getHolder();
25  }
26 
27  public InventoryHolder getRightSide() {
28  return inventory.getRightSide().getHolder();
29  }
30 
31  public Location getLocation() {
32  return new Location(getWorld(), getX(), getY(), getZ());
33  }
34 
35  public World getWorld() {
36  return ((Chest)getLeftSide()).getWorld();
37  }
38 
39  public double getX() {
40  return 0.5 * (((Chest)getLeftSide()).getX() + ((Chest)getRightSide()).getX());
41  }
42 
43  public double getY() {
44  return 0.5 * (((Chest)getLeftSide()).getY() + ((Chest)getRightSide()).getY());
45  }
46 
47  public double getZ() {
48  return 0.5 * (((Chest)getLeftSide()).getZ() + ((Chest)getRightSide()).getZ());
49  }
50 }
InventoryHolder getHolder()