summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPortal.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-15 18:13:55 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-07-15 18:13:55 +0200
commitc390604bc1343705ee17d6466da8dc53b5fa3b0e (patch)
treecbf9db66aae0fd8a85c88b0b1ef5ae9aea4d20ea /src/Blocks/BlockPortal.h
parentMerge pull request #2036 from cuberite/sign-metamirror (diff)
parentImproved maps (diff)
downloadcuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar.gz
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar.bz2
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar.lz
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar.xz
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.tar.zst
cuberite-c390604bc1343705ee17d6466da8dc53b5fa3b0e.zip
Diffstat (limited to 'src/Blocks/BlockPortal.h')
-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;
+ }
} ;