Minor Change to Tile Entity Exporting

Rewrote the code that changes the position of a tile entity to be
expressed in the schematic coordinate system. The new code should be
equivalent but easier to understand.
This commit is contained in:
SenseiKiwi
2013-07-15 04:38:51 -04:00
parent 8cc8f50f34
commit d21f29ec2c

View File

@@ -488,10 +488,11 @@ public class DungeonHelper
//Get the tile entity's description as a compound NBT tag
NBTTagCompound entityData = new NBTTagCompound();
tileEntity.writeToNBT(entityData);
//Change the tile entity's location to be relative to (xMin, yMin, zMin)
entityData.setInteger("x", entityData.getInteger("x") - xMin);
entityData.setInteger("y", entityData.getInteger("y") - yMin);
entityData.setInteger("z", entityData.getInteger("z") - zMin);
//Change the tile entity's location to the schematic coordinate system
entityData.setInteger("x", x);
entityData.setInteger("y", y);
entityData.setInteger("z", z);
tileEntities.appendTag(entityData);
}
}