diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-06 19:22:30 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-02-06 19:22:30 +0100 |
commit | a0914131253ed9ecb39e3e7eb10fa25d6ee27512 (patch) | |
tree | 5c4a64fdf67342f56eb929f044820f40e1a74ada /source/BlockArea.h | |
parent | Added new hooks: OnChunkAvailable(), OnChunkUnloaded() and OnChunkUnloading(). Modified OnChunkGenerated() signature. (diff) | |
download | cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar.gz cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar.bz2 cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar.lz cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar.xz cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.tar.zst cuberite-a0914131253ed9ecb39e3e7eb10fa25d6ee27512.zip |
Diffstat (limited to '')
-rw-r--r-- | source/BlockArea.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/BlockArea.h b/source/BlockArea.h index d9b21d933..797c37de6 100644 --- a/source/BlockArea.h +++ b/source/BlockArea.h @@ -59,6 +59,9 @@ public: // TODO: Write() is not too good an interface: if it fails, there's no way to repeat only for the parts that didn't write
// A better way may be to return a list of cBlockAreas for each part that didn't succeed writing, so that the caller may try again
+ /// Crops the internal contents by the specified amount of blocks from each border.
+ void Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ);
+
// Setters:
void SetRelBlockType (int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType);
void SetBlockType (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType);
@@ -135,6 +138,8 @@ protected: virtual void BlockSkyLight(const NIBBLETYPE * a_BlockSkyLight) override;
} ;
+ typedef NIBBLETYPE * NIBBLEARRAY;
+
int m_OriginX;
int m_OriginY;
@@ -157,6 +162,10 @@ protected: // Basic Getters:
NIBBLETYPE GetRelNibble(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE * a_Array) const;
NIBBLETYPE GetNibble (int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE * a_Array) const;
+
+ // Crop helpers:
+ void CropBlockTypes(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ);
+ void CropNibbles (NIBBLEARRAY & a_Array, int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ);
// tolua_begin
} ;
|