Added chest support. Double-width chests don't work too well yet.

This commit is contained in:
sk89q
2010-10-24 23:42:56 -07:00
parent cdfd4b81fa
commit ca1e522499
8 changed files with 435 additions and 9 deletions

View File

@ -199,6 +199,17 @@ public class Chunk {
((TileEntityBlock)block).fromTileEntityNBT(tileEntity);
}
return block;
// Chests
} else if (id == 54) {
ChestBlock block = new ChestBlock();
Map<String,Tag> tileEntity = getBlockTileEntity(pos);
if (tileEntity != null) {
((TileEntityBlock)block).fromTileEntityNBT(tileEntity);
}
return block;
} else {
return new BaseBlock(id, data);
@ -214,7 +225,7 @@ public class Chunk {
* @return child tag
* @throws InvalidFormatException
*/
private static Tag getChildTag(Map<String,Tag> items, String key, Class expected)
public static Tag getChildTag(Map<String,Tag> items, String key, Class expected)
throws InvalidFormatException {
if (!items.containsKey(key)) {
throw new InvalidFormatException("Missing a \"" + key + "\" tag");