Added Support for Importing Tile Entities

Added code to SchematicLoader so that we can import tile entities. Empty
chests and dispensers will still be filled as before.
This commit is contained in:
SenseiKiwi
2013-07-15 16:58:44 -04:00
parent 888e6fe590
commit 1ac934b5e4
3 changed files with 170 additions and 76 deletions

View File

@@ -397,18 +397,18 @@ public class DungeonHelper
//This could be done more efficiently, but honestly, this is the simplest approach and it
//makes it easy for us to verify that the code is correct.
for (int x = xStart; x <= xEnd; x++)
for (int y = yStart; y <= yEnd; y++)
{
for (int z = zStart; z <= zEnd; z++)
{
for (int y = yStart; y <= yEnd; y++)
for (int x = xStart; x <= xEnd; x++)
{
if (!world.isAirBlock(x, y, z))
{
xMax = x > xMax ? x : xMax;
zMax = z > zMax ? z : zMax;
yMax = y > yMax ? y : yMax;
xMin = x < xMin ? x : xMin;
zMin = z < zMin ? z : zMin;
yMin = y < yMin ? y : yMin;
@@ -427,11 +427,11 @@ public class DungeonHelper
byte[] blockData = new byte[width * height * length];
NBTTagList tileEntities = new NBTTagList();
for (int x = 0; x < width; x++)
for (int y = 0; y < height; y++)
{
for (int z = 0; z < length; z++)
{
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++)
{
int index = y * width * length + z * width + x;
int blockID = world.getBlockId(x + xMin, y + yMin, z + zMin);