summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockFire.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-10-16 10:06:34 +0200
committerGitHub <noreply@github.com>2019-10-16 10:06:34 +0200
commit221cc4ec5cb6301743e947eaabed3fecedba796f (patch)
tree4e44c8bb7523e5d1d04468fc906ae24674c10abc /src/Blocks/BlockFire.h
parentFixed crash in hopper while pulling items from blockentity above itself (#4412) (diff)
downloadcuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.gz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.bz2
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.lz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.xz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.zst
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.zip
Diffstat (limited to 'src/Blocks/BlockFire.h')
-rw-r--r--src/Blocks/BlockFire.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h
index ae0df0727..a4b3d3a05 100644
--- a/src/Blocks/BlockFire.h
+++ b/src/Blocks/BlockFire.h
@@ -18,11 +18,16 @@ public:
}
/** Portal boundary and direction variables */
- // 2014_03_30 _X: What are these used for? Why do we need extra variables?
+ // TODO: These need to be removed, BlockHandler instances are shared for all blocks in all worlds on the server
+ // and are not supposed to have any data in them.
int XZP, XZM;
NIBBLETYPE Dir;
- virtual void OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override
+
+
+
+
+ virtual void OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override
{
/*
PORTAL FINDING ALGORITH
@@ -38,14 +43,23 @@ public:
*/
// a_BlockY - 1: Because we want the block below the fire
- FindAndSetPortalFrame(a_BlockX, a_BlockY - 1, a_BlockZ, a_ChunkInterface, a_WorldInterface);
+ FindAndSetPortalFrame(a_BlockPos.x, a_BlockPos.y - 1, a_BlockPos.z, a_ChunkInterface, a_WorldInterface);
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+
+
+
+
+ virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
{
// No pickups from this block
+ return {};
}
+
+
+
+
virtual bool IsClickedThrough(void) override
{
return true;
@@ -102,6 +116,10 @@ public:
return true;
}
+
+
+
+
/** Finds entire frame in any direction with the coordinates of a base block and fills hole with nether portal (START HERE) */
void FindAndSetPortalFrame(int X, int Y, int Z, cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface)
{