summaryrefslogtreecommitdiffstats
path: root/source/BlockArea.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-07 11:45:30 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-07 11:45:30 +0100
commitfe7e07d69d3227d6e5cfbeefd88b47b3f5961184 (patch)
tree1e0b8b33b1b195ad3b90b6c6e81d00240be57291 /source/BlockArea.cpp
parentcBlockArea can now be saved as a .schematic file. (diff)
downloadcuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar.gz
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar.bz2
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar.lz
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar.xz
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.tar.zst
cuberite-fe7e07d69d3227d6e5cfbeefd88b47b3f5961184.zip
Diffstat (limited to '')
-rw-r--r--source/BlockArea.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/source/BlockArea.cpp b/source/BlockArea.cpp
index f7132f50d..11878edeb 100644
--- a/source/BlockArea.cpp
+++ b/source/BlockArea.cpp
@@ -151,6 +151,51 @@ bool cBlockArea::Write(cWorld * a_World, int a_MinBlockX, int a_MinBlockY, int a
+void cBlockArea::CopyTo(cBlockArea & a_Into) const
+{
+ if (&a_Into == this)
+ {
+ LOGWARNING("Trying to copy a cBlockArea into self, ignoring.");
+ return;
+ }
+
+ a_Into.Clear();
+ a_Into.SetSize(m_SizeX, m_SizeY, m_SizeZ, GetDataTypes());
+ a_Into.m_OriginX = m_OriginX;
+ a_Into.m_OriginY = m_OriginY;
+ a_Into.m_OriginZ = m_OriginZ;
+ int BlockCount = GetBlockCount();
+ if (HasBlockTypes())
+ {
+ memcpy(a_Into.m_BlockTypes, m_BlockTypes, BlockCount * sizeof(BLOCKTYPE));
+ }
+ if (HasBlockMetas())
+ {
+ memcpy(a_Into.m_BlockMetas, m_BlockMetas, BlockCount * sizeof(NIBBLETYPE));
+ }
+ if (HasBlockLights())
+ {
+ memcpy(a_Into.m_BlockLight, m_BlockLight, BlockCount * sizeof(NIBBLETYPE));
+ }
+ if (HasBlockSkyLights())
+ {
+ memcpy(a_Into.m_BlockSkyLight, m_BlockSkyLight, BlockCount * sizeof(NIBBLETYPE));
+ }
+}
+
+
+
+
+
+void cBlockArea::CopyFrom(const cBlockArea & a_From)
+{
+ a_From.CopyTo(*this);
+}
+
+
+
+
+
void cBlockArea::DumpToRawFile(const AString & a_FileName)
{
cFile f;