From 211cec621e5e23e0e3a9c5e0880ddea24b6418c3 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Thu, 19 Jul 2018 22:36:46 +0100 Subject: cBlockArea: Write all present data types by default (#4252) cBlockArea::Write now defaults to use GetDataTypes() instead of assuming all data types are present. Fixes cuberite/WorldEdit#130 --- src/BlockArea.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/BlockArea.h') diff --git a/src/BlockArea.h b/src/BlockArea.h index 60a2821bd..4a68f9a31 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -120,11 +120,27 @@ public: /** Writes the area back into cWorld at the coords specified. Returns true if successful in all chunks, false if only partially / not at all. Doesn't wake up the simulators. */ - bool Write(cForEachChunkProvider & a_ForEachChunkProvider, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes = baTypes | baMetas | baBlockEntities); + bool Write(cForEachChunkProvider & a_ForEachChunkProvider, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes); /** Writes the area back into cWorld at the coords specified. Returns true if successful in all chunks, false if only partially / not at all. Doesn't wake up the simulators. */ - bool Write(cForEachChunkProvider & a_ForEachChunkProvider, const Vector3i & a_MinCoords, int a_DataTypes = baTypes | baMetas | baBlockEntities); + bool Write(cForEachChunkProvider & a_ForEachChunkProvider, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ) + { + // Write all available data + return Write(a_ForEachChunkProvider, a_MinBlockX, a_MinBlockY, a_MinBlockZ, GetDataTypes()); + } + + /** Writes the area back into cWorld at the coords specified. Returns true if successful in all chunks, false if only partially / not at all. + Doesn't wake up the simulators. */ + bool Write(cForEachChunkProvider & a_ForEachChunkProvider, const Vector3i & a_MinCoords, int a_DataTypes); + + /** Writes the area back into cWorld at the coords specified. Returns true if successful in all chunks, false if only partially / not at all. + Doesn't wake up the simulators. */ + bool Write(cForEachChunkProvider & a_ForEachChunkProvider, const Vector3i & a_MinCoords) + { + // Write all available data + return Write(a_ForEachChunkProvider, a_MinCoords.x, a_MinCoords.y, a_MinCoords.z, GetDataTypes()); + } // tolua_begin -- cgit v1.2.3