summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-03-25 21:59:25 +0100
committermadmaxoft <github@xoft.cz>2014-03-25 21:59:41 +0100
commit87e0bd54b426bafb6b267725b0e1a94511a38f4e (patch)
tree1d21b4f61db53554b4f59c1883a8e5b695c8eadd /src/WorldStorage
parentAdded Vector3::Move(const Vector3 &). (diff)
downloadcuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar.gz
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar.bz2
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar.lz
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar.xz
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.tar.zst
cuberite-87e0bd54b426bafb6b267725b0e1a94511a38f4e.zip
Diffstat (limited to 'src/WorldStorage')
-rw-r--r--src/WorldStorage/SchematicFileSerializer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp
index ef67fdb13..d8531d965 100644
--- a/src/WorldStorage/SchematicFileSerializer.cpp
+++ b/src/WorldStorage/SchematicFileSerializer.cpp
@@ -197,7 +197,7 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP
}
// Copy the block types and metas:
- int NumBytes = a_BlockArea.m_SizeX * a_BlockArea.m_SizeY * a_BlockArea.m_SizeZ;
+ int NumBytes = a_BlockArea.GetBlockCount();
if (a_NBT.GetDataLength(TBlockTypes) < NumBytes)
{
LOG("BlockTypes truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
@@ -209,7 +209,7 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP
if (AreMetasPresent)
{
- int NumBytes = a_BlockArea.m_SizeX * a_BlockArea.m_SizeY * a_BlockArea.m_SizeZ;
+ int NumBytes = a_BlockArea.GetBlockCount();
if (a_NBT.GetDataLength(TBlockMetas) < NumBytes)
{
LOG("BlockMetas truncated in the schematic file (exp %d, got %d bytes). Loading partial.",
@@ -230,9 +230,9 @@ bool cSchematicFileSerializer::LoadFromSchematicNBT(cBlockArea & a_BlockArea, cP
AString cSchematicFileSerializer::SaveToSchematicNBT(const cBlockArea & a_BlockArea)
{
cFastNBTWriter Writer("Schematic");
- Writer.AddShort("Width", a_BlockArea.m_SizeX);
- Writer.AddShort("Height", a_BlockArea.m_SizeY);
- Writer.AddShort("Length", a_BlockArea.m_SizeZ);
+ Writer.AddShort("Width", a_BlockArea.m_Size.x);
+ Writer.AddShort("Height", a_BlockArea.m_Size.y);
+ Writer.AddShort("Length", a_BlockArea.m_Size.z);
Writer.AddString("Materials", "Alpha");
if (a_BlockArea.HasBlockTypes())
{