summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockFenceGate.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/BlockFenceGate.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/BlockFenceGate.h')
-rw-r--r--src/Blocks/BlockFenceGate.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Blocks/BlockFenceGate.h b/src/Blocks/BlockFenceGate.h
index b5c1323bd..81e93fa50 100644
--- a/src/Blocks/BlockFenceGate.h
+++ b/src/Blocks/BlockFenceGate.h
@@ -16,13 +16,11 @@ public:
{
}
-
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
a_Pickups.Add(m_BlockType, 1, 0); // Reset meta to zero
}
-
virtual bool GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface, cPlayer * a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
@@ -35,7 +33,6 @@ public:
return true;
}
-
virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override
{
NIBBLETYPE OldMetaData = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
@@ -55,20 +52,17 @@ public:
a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle());
}
-
virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
{
a_WorldInterface.SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
}
-
virtual bool IsUseable(void) override
{
return true;
}
-
- /// Converts the player's yaw to placed gate's blockmeta
+ /** Converts the player's yaw to placed gate's blockmeta */
inline static NIBBLETYPE PlayerYawToMetaData(double a_Yaw)
{
ASSERT((a_Yaw >= -180) && (a_Yaw < 180));
@@ -95,6 +89,25 @@ public:
return 0x3;
}
}
+
+ virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
+ {
+ UNUSED(a_Meta);
+ switch (m_BlockType)
+ {
+ case E_BLOCK_OAK_FENCE_GATE: return 13;
+ case E_BLOCK_SPRUCE_FENCE_GATE: return 34;
+ case E_BLOCK_BIRCH_FENCE_GATE: return 2;
+ case E_BLOCK_JUNGLE_FENCE_GATE: return 10;
+ case E_BLOCK_DARK_OAK_FENCE_GATE: return 26;
+ case E_BLOCK_ACACIA_FENCE_GATE: return 15;
+ default:
+ {
+ ASSERT(!"Unhandled blocktype in fence gate handler!");
+ return 0;
+ }
+ }
+ }
} ;