Updated foundation classes a bit and added raw access for NBT. This release marks experimental support for custom blocks, and nearly all future Minecraft blocks, and is also the beginning of the gradual transition to the new foundation classes as a replacement of the current BaseBlock, etc. classes.

This commit is contained in:
sk89q
2012-08-23 16:52:37 -07:00
parent a2aae2c4da
commit 48af65cac3
21 changed files with 1037 additions and 515 deletions

View File

@ -182,12 +182,12 @@ public class AnvilChunk implements Chunk {
* @return
* @throws DataException
*/
private Map<String, Tag> getBlockTileEntity(Vector pos) throws DataException {
private CompoundTag getBlockTileEntity(Vector pos) throws DataException {
if (tileEntities == null) {
populateTileEntities();
}
return tileEntities.get(new BlockVector(pos));
return new CompoundTag("", tileEntities.get(new BlockVector(pos)));
}
@Override
@ -213,8 +213,8 @@ public class AnvilChunk implements Chunk {
}
if (block instanceof TileEntityBlock) {
Map<String, Tag> tileEntity = getBlockTileEntity(pos);
((TileEntityBlock) block).fromTileEntityNBT(tileEntity);
CompoundTag tileEntity = getBlockTileEntity(pos);
((TileEntityBlock) block).setNbtData(tileEntity);
}
return block;