summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPortal.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-30 16:50:15 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-14 22:46:30 +0200
commit8656e149c8820272a882406912790f0075ed5f28 (patch)
treeb4f89f69dfb026f76862046637fd99162a49d3c9 /src/Blocks/BlockPortal.h
parentMerge pull request #2352 from mmdk95/master (diff)
downloadcuberite-8656e149c8820272a882406912790f0075ed5f28.tar
cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.gz
cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.bz2
cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.lz
cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.xz
cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.zst
cuberite-8656e149c8820272a882406912790f0075ed5f28.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockPortal.h49
1 files changed, 26 insertions, 23 deletions
diff --git a/src/Blocks/BlockPortal.h b/src/Blocks/BlockPortal.h
index 581a29447..c18acbdb5 100644
--- a/src/Blocks/BlockPortal.h
+++ b/src/Blocks/BlockPortal.h
@@ -33,7 +33,6 @@ public:
return true;
}
-
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// No pickups
@@ -64,21 +63,20 @@ public:
{
case 0x1:
{
- static const struct
- {
- int x, y, z;
- } PortalCheck[] =
+ static const std::array<Vector3i, 4> PortalCheck
{
- { 0, 1, 0},
- { 0, -1, 0},
- { 1, 0, 0},
- {-1, 0, 0},
- } ;
+ {
+ { 0, 1, 0 },
+ { 0, -1, 0 },
+ { 1, 0, 0 },
+ { -1, 0, 0 },
+ }
+ };
- for (size_t i = 0; i < ARRAYCOUNT(PortalCheck); i++)
+ for (const auto & Direction : PortalCheck)
{
BLOCKTYPE Block;
- a_Chunk.UnboundedRelGetBlockType(a_RelX + PortalCheck[i].x, a_RelY + PortalCheck[i].y, a_RelZ + PortalCheck[i].z, Block);
+ a_Chunk.UnboundedRelGetBlockType(a_RelX + Direction.x, a_RelY + Direction.y, a_RelZ + Direction.z, Block);
if ((Block != E_BLOCK_NETHER_PORTAL) && (Block != E_BLOCK_OBSIDIAN))
{
@@ -89,21 +87,20 @@ public:
}
case 0x2:
{
- static const struct
- {
- int x, y, z;
- } PortalCheck[] =
+ static const std::array<Vector3i, 4> PortalCheck
{
- { 0, 1, 0},
- { 0, -1, 0},
- { 0, 0, -1},
- { 0, 0, 1},
- } ;
+ {
+ { 0, 1, 0 },
+ { 0, -1, 0 },
+ { 0, 0, -1 },
+ { 0, 0, 1 },
+ }
+ };
- for (size_t i = 0; i < ARRAYCOUNT(PortalCheck); i++)
+ for (const auto & Direction : PortalCheck)
{
BLOCKTYPE Block;
- a_Chunk.UnboundedRelGetBlockType(a_RelX + PortalCheck[i].x, a_RelY + PortalCheck[i].y, a_RelZ + PortalCheck[i].z, Block);
+ a_Chunk.UnboundedRelGetBlockType(a_RelX + Direction.x, a_RelY + Direction.y, a_RelZ + Direction.z, Block);
if ((Block != E_BLOCK_NETHER_PORTAL) && (Block != E_BLOCK_OBSIDIAN))
{
@@ -115,6 +112,12 @@ public:
}
return true;
}
+
+ virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
+ {
+ UNUSED(a_Meta);
+ return 24;
+ }
} ;