14 #include "../BlockInfo.h"
15 #include "../Entities/Player.h"
16 #include "../BlockInfo.h"
60 const bool IsTopSlab = (a_Meta & 0x08) == 0x08;
67 return a_ClickedDirectly ? CanClickCombine : !CanClickCombine;
98 return (a_Meta ^ 0x08);
125 ASSERT(!
"Unhandled meta in slab handler!");
142 ASSERT(!
"Unhandled meta in slab handler!");
157 ASSERT(!
"Unhandled blocktype in slab handler!");
169 if (a_BlockMeta & 0x08)
211 ASSERT(!
"Unhandled double slab type!");
@ E_META_WOODEN_SLAB_BIRCH
@ E_META_STONE_SLAB_PLANKS
@ E_META_WOODEN_SLAB_ACACIA
@ E_META_STONE_SLAB_STONE
@ E_META_STONE_SLAB_STONE_BRICK
@ E_META_STONE_SLAB_BRICK
@ E_META_WOODEN_SLAB_JUNGLE
@ E_META_STONE_SLAB_NETHER_BRICK
@ E_META_STONE_SLAB_QUARTZ
@ E_META_WOODEN_SLAB_SPRUCE
@ E_META_STONE_SLAB_COBBLESTONE
@ E_META_WOODEN_SLAB_DARK_OAK
@ E_META_STONE_SLAB_SANDSTONE
@ E_BLOCK_DOUBLE_WOODEN_SLAB
@ E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB
@ E_BLOCK_DOUBLE_STONE_SLAB
@ E_BLOCK_PURPUR_DOUBLE_SLAB
@ E_BLOCK_RED_SANDSTONE_SLAB
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
virtual bool IsInsideBlock(const Vector3d a_RelPosition, const NIBBLETYPE a_BlockMeta) const
Tests if a_RelPosition is inside the block, where a_RelPosition is relative to the origin of the bloc...
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
static const cBlockHandler & For(BLOCKTYPE a_BlockType)
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
const BLOCKTYPE m_BlockType
virtual bool DoesIgnoreBuildCollision(const cWorld &a_World, const cItem &a_HeldItem, const Vector3i a_Position, const NIBBLETYPE a_Meta, const eBlockFace a_ClickedBlockFace, const bool a_ClickedDirectly) const override
Checks if the player can build "inside" this block.
virtual NIBBLETYPE MetaMirrorXZ(NIBBLETYPE a_Meta) const override
Mirros a given block meta around the XZ plane.
virtual bool IsInsideBlock(Vector3d a_Position, const NIBBLETYPE a_BlockMeta) const override
Tests if a_RelPosition is inside the block, where a_RelPosition is relative to the origin of the bloc...
virtual void OnCancelRightClick(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace) const override
Called when a right click to this block is cancelled.
static bool IsAnySlabType(BLOCKTYPE a_BlockType)
Returns true if the specified blocktype is one of the slabs handled by this handler.
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
static BLOCKTYPE GetSingleSlabType(BLOCKTYPE a_BlockType)
cWorld * GetWorld(void) const
const cItem & GetEquippedItem(void) const
This class bridges a vector of cItem for safe access via Lua.
virtual void SendBlockTo(int a_X, int a_Y, int a_Z, const cPlayer &a_Player) override
Sends the block at the specified coords to the player.