summaryrefslogtreecommitdiffstats
path: root/src/Blocks/ChunkInterface.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2014-09-26 17:04:26 +0200
committerworktycho <work.tycho@gmail.com>2014-09-26 17:04:26 +0200
commit411c69b420acdc1e103a76a1a52e2c488aee5718 (patch)
tree06e33fb4b17d9c782ebb834a9821571f11ae103c /src/Blocks/ChunkInterface.h
parentImproved searching for spawn. (diff)
parentMerge branch 'master' into redstoneTests (diff)
downloadcuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.gz
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.bz2
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.lz
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.xz
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.zst
cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.zip
Diffstat (limited to 'src/Blocks/ChunkInterface.h')
-rw-r--r--src/Blocks/ChunkInterface.h63
1 files changed, 13 insertions, 50 deletions
diff --git a/src/Blocks/ChunkInterface.h b/src/Blocks/ChunkInterface.h
index d5f1f1273..51647dc04 100644
--- a/src/Blocks/ChunkInterface.h
+++ b/src/Blocks/ChunkInterface.h
@@ -1,13 +1,12 @@
#pragma once
-#include "../ChunkMap.h"
#include "../ForEachChunkProvider.h"
#include "WorldInterface.h"
-
+class cChunkMap;
class cChunkInterface:
public cForEachChunkProvider
@@ -16,70 +15,34 @@ public:
cChunkInterface(cChunkMap * a_ChunkMap) : m_ChunkMap(a_ChunkMap) {}
- BLOCKTYPE GetBlock(int a_BlockX, int a_BlockY, int a_BlockZ)
- {
- return m_ChunkMap->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- }
- BLOCKTYPE GetBlock(const Vector3i & a_Pos)
- {
- return GetBlock(a_Pos.x, a_Pos.y, a_Pos.z);
- }
- NIBBLETYPE GetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ)
- {
- return m_ChunkMap->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- }
+ BLOCKTYPE GetBlock(int a_BlockX, int a_BlockY, int a_BlockZ);
+ BLOCKTYPE GetBlock(const Vector3i & a_Pos);
+ NIBBLETYPE GetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ);
- bool GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
- {
- return m_ChunkMap->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
- }
+ bool GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta);
/** Sets the block at the specified coords to the specified value.
Full processing, incl. updating neighbors, is performed.
*/
- void SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
- {
- m_ChunkMap->SetBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
- }
+ void SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- void SetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_MetaData)
- {
- m_ChunkMap->SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, a_MetaData);
- }
+ void SetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_MetaData);
- void QueueSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_TickDelay, BLOCKTYPE a_PreviousBlockType, cWorldInterface & a_WorldInterface)
- {
- m_ChunkMap->QueueSetBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_WorldInterface.GetWorldAge() + a_TickDelay, a_PreviousBlockType);
- }
+ void QueueSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_TickDelay, BLOCKTYPE a_PreviousBlockType, cWorldInterface & a_WorldInterface);
/** Sets the block at the specified coords to the specified value.
The replacement doesn't trigger block updates.
The replaced blocks aren't checked for block entities (block entity is leaked if it exists at this block)
*/
- void FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
- {
- m_ChunkMap->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
- }
+ void FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- void FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
- {
- FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
- }
+ void FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
- {
- m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ);
- }
+ void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ);
- virtual bool ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback) override
- {
- return m_ChunkMap->ForEachChunkInRect(a_MinChunkX, a_MaxChunkX, a_MinChunkZ, a_MaxChunkZ, a_Callback);
- }
+ virtual bool ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback) override;
- virtual bool WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) override
- {
- return m_ChunkMap->WriteBlockArea(a_Area, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes);
- }
+ virtual bool WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) override;
bool DigBlock(cWorldInterface & a_WorldInterface, int a_X, int a_Y, int a_Z);