diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 21:12:44 +0200 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2017-09-01 21:12:44 +0200 |
commit | 6e3e7552e67dfc0254c3e99bcd32fea02f10d062 (patch) | |
tree | 84bfd40d2c2693cab44a47d4902aa601d8a715e6 /src/BlockArea.h | |
parent | d (diff) | |
parent | SetSwimState now takes into account head height (diff) | |
download | cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.gz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.bz2 cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.lz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.xz cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.tar.zst cuberite-6e3e7552e67dfc0254c3e99bcd32fea02f10d062.zip |
Diffstat (limited to 'src/BlockArea.h')
-rw-r--r-- | src/BlockArea.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/BlockArea.h b/src/BlockArea.h index 2e35b9436..e7080ed88 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -1,4 +1,4 @@ - + // BlockArea.h // Interfaces to the cBlockArea object representing an area of block data that can be queried from cWorld and then accessed again without further queries @@ -17,13 +17,14 @@ #include "ForEachChunkProvider.h" #include "ChunkDataCallback.h" #include "Cuboid.h" +#include <functional> // fwd: class cCuboid; - +using cBlockEntityCallback = std::function<bool(cBlockEntity &)>; @@ -376,18 +377,18 @@ public: /** Calls the callback for the block entity at the specified coords. Returns false if there is no block entity at those coords, or the block area doesn't have baBlockEntities. Returns the value that the callback has returned if there is a block entity. */ - bool DoWithBlockEntityRelAt(int a_RelX, int a_RelY, int a_RelZ, cItemCallback<cBlockEntity> & a_Callback); + bool DoWithBlockEntityRelAt(int a_RelX, int a_RelY, int a_RelZ, const cBlockEntityCallback & a_Callback); /** Calls the callback for the block entity at the specified coords. Returns false if there is no block entity at those coords. Returns the value that the callback has returned if there is a block entity. */ - bool DoWithBlockEntityAt (int a_BlockX, int a_BlockY, int a_BlockZ, cItemCallback<cBlockEntity> & a_Callback); + bool DoWithBlockEntityAt (int a_BlockX, int a_BlockY, int a_BlockZ, const cBlockEntityCallback & a_Callback); /** Calls the callback for all the block entities. If the callback returns true, aborts the enumeration and returns false. If the callback returns true, continues with the next BE. Returns true if all block entities have been enumerated (including the case when there is none or the area is without baBlockEntities). */ - bool ForEachBlockEntity(cItemCallback<cBlockEntity> & a_Callback); + bool ForEachBlockEntity(const cBlockEntityCallback & a_Callback); /** Direct read-only access to block entities. */ const cBlockEntities & GetBlockEntities(void) const { ASSERT(HasBlockEntities()); return *m_BlockEntities; } |