summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockFire.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-03 20:18:34 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-03 20:18:34 +0200
commite1ba51e6ca1cdff477279b7064fc0e0b5117c085 (patch)
treeeaad9f451838b75cd990b548b93f8287fbd75865 /src/Blocks/BlockFire.h
parentFixed some bugs (diff)
parentFixed a few MSVC type warnings. (diff)
downloadcuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar.gz
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar.bz2
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar.lz
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar.xz
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.tar.zst
cuberite-e1ba51e6ca1cdff477279b7064fc0e0b5117c085.zip
Diffstat (limited to 'src/Blocks/BlockFire.h')
-rw-r--r--src/Blocks/BlockFire.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h
index a25b87858..c8f158e7e 100644
--- a/src/Blocks/BlockFire.h
+++ b/src/Blocks/BlockFire.h
@@ -17,25 +17,27 @@ public:
}
/// Portal boundary and direction variables
- int XZP, XZM, Dir; // For wont of a better name...
+ // 2014_03_30 _X: What are these used for? Why do we need extra variables?
+ 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
{
/*
PORTAL FINDING ALGORITH
=======================
- -Get clicked base block
- -Trace upwards to find first obsidian block; aborts if anything other than obsidian or air is encountered.
- Uses this value as a reference (the 'ceiling')
- -For both directions (if one fails, try the other), BASE (clicked) block:
- -Go in one direction, only stop if a non obsidian block is encountered (abort) OR a portal border is encountered (FindObsidianCeiling returns -1)
- -If a border was encountered, go the other direction and repeat above
- -Write borders to XZP and XZM, write direction portal faces to Dir
- -Loop through boundary variables, and fill with portal blocks based on Dir with meta from Dir
+ - Get clicked base block
+ - Trace upwards to find first obsidian block; aborts if anything other than obsidian or air is encountered.
+ Uses this value as a reference (the 'ceiling')
+ - For both directions (if one fails, try the other), BASE (clicked) block:
+ - Go in one direction, only stop if a non obsidian block is encountered (abort) OR a portal border is encountered (FindObsidianCeiling returns -1)
+ - If a border was encountered, go the other direction and repeat above
+ - Write borders to XZP and XZM, write direction portal faces to Dir
+ - Loop through boundary variables, and fill with portal blocks based on Dir with meta from Dir
*/
a_BlockY--; // Because we want the block below the fire
- FindAndSetPortalFrame(a_BlockX, a_BlockY, a_BlockZ, a_ChunkInterface, a_WorldInterface); // Brought to you by Aperture Science
+ FindAndSetPortalFrame(a_BlockX, a_BlockY, a_BlockZ, a_ChunkInterface, a_WorldInterface);
}
virtual void OnDigging(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override