use of net.glowstone.inventory.GlowDoubleChestInventory in project Glowstone by GlowstoneMC.
the class GlowChest method getInventory.
@Override
public Inventory getInventory() {
GlowBlock me = getBlock();
BlockChest blockChest = (BlockChest) ItemTable.instance().getBlock(me.getType());
BlockFace attachedChest = blockChest.getAttachedChest(me);
if (attachedChest != null) {
Block nearbyBlock = me.getRelative(attachedChest);
GlowChest nearbyChest = (GlowChest) nearbyBlock.getState();
switch(attachedChest) {
case SOUTH:
case EAST:
return new GlowDoubleChestInventory(this, nearbyChest);
case WEST:
case NORTH:
return new GlowDoubleChestInventory(nearbyChest, this);
default:
GlowServer.logger.warning("GlowChest#getInventory() can only handle N/O/S/W BlockFaces, got " + attachedChest);
return getBlockInventory();
}
}
return getBlockInventory();
}
Aggregations