summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-03-11 18:23:21 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2014-03-11 18:23:21 +0100
commite213e5f9fcb3681a5f383546e17b9800d4a4804a (patch)
treeb4bd964c4966ed1103f859e58b97f637a73cc8cc /src
parentUsing ```const Vector3i &``` (diff)
downloadcuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar.gz
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar.bz2
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar.lz
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar.xz
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.tar.zst
cuberite-e213e5f9fcb3681a5f383546e17b9800d4a4804a.zip
Diffstat (limited to 'src')
-rw-r--r--src/BlockArea.cpp6
-rw-r--r--src/BlockArea.h5
-rw-r--r--src/WorldStorage/SchematicFileSerializer.cpp6
3 files changed, 9 insertions, 8 deletions
diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp
index dfdf998df..983dbe46b 100644
--- a/src/BlockArea.cpp
+++ b/src/BlockArea.cpp
@@ -168,7 +168,7 @@ cBlockArea::cBlockArea(void) :
m_SizeX(0),
m_SizeY(0),
m_SizeZ(0),
- m_Offset(0,0,0),
+ m_WEOffset(0, 0, 0),
m_BlockTypes(NULL),
m_BlockMetas(NULL),
m_BlockLight(NULL),
@@ -257,7 +257,7 @@ void cBlockArea::Create(int a_SizeX, int a_SizeY, int a_SizeZ, int a_DataTypes)
void cBlockArea::SetOffset(int a_OffsetX, int a_OffsetY, int a_OffsetZ)
{
- m_Offset.Set(a_OffsetX, a_OffsetY, a_OffsetZ);
+ m_WEOffset.Set(a_OffsetX, a_OffsetY, a_OffsetZ);
}
@@ -266,7 +266,7 @@ void cBlockArea::SetOffset(int a_OffsetX, int a_OffsetY, int a_OffsetZ)
void cBlockArea::SetOffset(const Vector3i & a_Offset)
{
- m_Offset.Set(a_Offset.x, a_Offset.y, a_Offset.z);
+ m_WEOffset.Set(a_Offset.x, a_Offset.y, a_Offset.z);
}
diff --git a/src/BlockArea.h b/src/BlockArea.h
index 75b8db3a6..76424d02f 100644
--- a/src/BlockArea.h
+++ b/src/BlockArea.h
@@ -221,7 +221,7 @@ public:
NIBBLETYPE GetBlockLight (int a_BlockX, int a_BlockY, int a_BlockZ) const;
NIBBLETYPE GetRelBlockSkyLight(int a_RelX, int a_RelY, int a_RelZ) const;
NIBBLETYPE GetBlockSkyLight (int a_BlockX, int a_BlockY, int a_BlockZ) const;
- const Vector3i & GetOffset (void) const {return m_Offset;}
+ const Vector3i & GetOffset (void) const {return m_WEOffset;}
void SetBlockTypeMeta (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
void SetRelBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
@@ -302,7 +302,8 @@ protected:
int m_SizeY;
int m_SizeZ;
- Vector3i m_Offset;
+ // Used for schematics that are created by the WorldEdit plugin. The offset is used for player-relative pasting.
+ Vector3i m_WEOffset;
BLOCKTYPE * m_BlockTypes;
NIBBLETYPE * m_BlockMetas; // Each meta is stored as a separate byte for faster access
diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp
index 0aea931eb..b899540df 100644
--- a/src/WorldStorage/SchematicFileSerializer.cpp
+++ b/src/WorldStorage/SchematicFileSerializer.cpp
@@ -253,9 +253,9 @@ AString cSchematicFileSerializer::SaveToSchematicNBT(const cBlockArea & a_BlockA
Writer.AddByteArray("Data", Dummy.data(), Dummy.size());
}
- Writer.AddInt("WEOffsetX", a_BlockArea.m_Offset.x);
- Writer.AddInt("WEOffsetY", a_BlockArea.m_Offset.y);
- Writer.AddInt("WEOffsetZ", a_BlockArea.m_Offset.z);
+ Writer.AddInt("WEOffsetX", a_BlockArea.m_WEOffset.x);
+ Writer.AddInt("WEOffsetY", a_BlockArea.m_WEOffset.y);
+ Writer.AddInt("WEOffsetZ", a_BlockArea.m_WEOffset.z);
// TODO: Save entities and block entities
Writer.BeginList("Entities", TAG_Compound);