Cuberite
A lightweight, fast and extensible game server for Minecraft
Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | List of all members
cBlockDoorHandler Class Referencefinal

#include <BlockDoor.h>

Inheritance diagram for cBlockDoorHandler:
Inheritance graph
[legend]
Collaboration diagram for cBlockDoorHandler:
Collaboration graph
[legend]

Static Public Member Functions

static bool CanBeOn (BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 Returns true if door can be placed on the specified block type. More...
 
static Vector3i GetRelativeDirectionToOutside (NIBBLETYPE a_BlockMeta)
 Returns a vector pointing one block in the direction the door is facing (where the outside is). More...
 
static bool IsDoorBlockType (BLOCKTYPE a_Block)
 Returns true if the specified blocktype is any kind of door. More...
 
static bool IsOpen (cChunkInterface &a_ChunkInterface, const Vector3i a_BlockPos)
 Returns true iff the door at the specified coords is open. More...
 
static void SetOpen (cChunkInterface &a_ChunkInterface, const Vector3i a_BlockPos, bool a_Open)
 Sets the door to the specified state. More...
 
- Static Public Member Functions inherited from cYawRotator< cBlockHandler, 0x03, 0x03, 0x00, 0x01, 0x02 >
static NIBBLETYPE YawToMetaData (double a_Rotation)
 Converts the rotation value as returned by cPlayer::GetYaw() to the appropriate metadata value for a block placed by a player facing that way. More...
 

Private Types

using Super = cYawRotator< cBlockHandler, 0x03, 0x03, 0x00, 0x01, 0x02 >
 

Private Member Functions

virtual bool CanBeAt (const cChunk &a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override
 
virtual cItems ConvertToPickups (const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
 
virtual ColourID GetMapBaseColourID (NIBBLETYPE a_Meta) const override
 
virtual cBoundingBox GetPlacementCollisionBox (BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) const override
 
virtual bool IsUseable (void) const override
 
virtual NIBBLETYPE MetaMirrorXY (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaMirrorYZ (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaRotateCCW (NIBBLETYPE a_Meta) const override
 
virtual NIBBLETYPE MetaRotateCW (NIBBLETYPE a_Meta) const override
 
virtual void OnBroken (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta, const cEntity *a_Digger) const override
 
virtual void OnCancelRightClick (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace) const override
 
virtual bool OnUse (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos) const override
 

Static Private Member Functions

static void ChangeDoor (cChunkInterface &a_ChunkInterface, const Vector3i a_BlockPos)
 Changes the door at the specified coords from open to close or vice versa. More...
 
static NIBBLETYPE GetCompleteDoorMeta (cChunkInterface &a_ChunkInterface, const Vector3i a_BlockPos)
 Returns the complete meta composed from the both parts of the door as (TopMeta << 4) | BottomMeta The coords may point to either part of the door. More...
 

Additional Inherited Members

- Public Member Functions inherited from cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >
constexpr cMetaRotator (BLOCKTYPE a_BlockType)
 
- Protected Member Functions inherited from cYawRotator< cBlockHandler, 0x03, 0x03, 0x00, 0x01, 0x02 >
 ~cYawRotator ()=default
 
- Protected Member Functions inherited from cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched >
 ~cMetaRotator ()=default
 

Detailed Description

Definition at line 16 of file BlockDoor.h.

Member Typedef Documentation

◆ Super

using cBlockDoorHandler::Super = cYawRotator<cBlockHandler, 0x03, 0x03, 0x00, 0x01, 0x02>
private

Definition at line 19 of file BlockDoor.h.

Member Function Documentation

◆ CanBeAt()

virtual bool cBlockDoorHandler::CanBeAt ( const cChunk a_Chunk,
const Vector3i  a_Position,
const NIBBLETYPE  a_Meta 
) const
inlineoverrideprivatevirtual

Definition at line 191 of file BlockDoor.h.

◆ CanBeOn()

static bool cBlockDoorHandler::CanBeOn ( BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
inlinestatic

Returns true if door can be placed on the specified block type.

Definition at line 26 of file BlockDoor.h.

◆ ChangeDoor()

static void cBlockDoorHandler::ChangeDoor ( cChunkInterface a_ChunkInterface,
const Vector3i  a_BlockPos 
)
inlinestaticprivate

Changes the door at the specified coords from open to close or vice versa.

Definition at line 245 of file BlockDoor.h.

◆ ConvertToPickups()

virtual cItems cBlockDoorHandler::ConvertToPickups ( const NIBBLETYPE  a_BlockMeta,
const cItem *const  a_Tool 
) const
inlineoverrideprivatevirtual

Definition at line 159 of file BlockDoor.h.

◆ GetCompleteDoorMeta()

static NIBBLETYPE cBlockDoorHandler::GetCompleteDoorMeta ( cChunkInterface a_ChunkInterface,
const Vector3i  a_BlockPos 
)
inlinestaticprivate

Returns the complete meta composed from the both parts of the door as (TopMeta << 4) | BottomMeta The coords may point to either part of the door.

The returned value has bit 3 (0x08) set iff the coords point to the top part of the door. Fails silently for (invalid) doors on the world's top and bottom.

Definition at line 212 of file BlockDoor.h.

◆ GetMapBaseColourID()

virtual ColourID cBlockDoorHandler::GetMapBaseColourID ( NIBBLETYPE  a_Meta) const
inlineoverrideprivatevirtual

Definition at line 254 of file BlockDoor.h.

◆ GetPlacementCollisionBox()

cBoundingBox cBlockDoorHandler::GetPlacementCollisionBox ( BLOCKTYPE  a_XM,
BLOCKTYPE  a_XP,
BLOCKTYPE  a_YM,
BLOCKTYPE  a_YP,
BLOCKTYPE  a_ZM,
BLOCKTYPE  a_ZP 
) const
overrideprivatevirtual

Definition at line 122 of file BlockDoor.cpp.

◆ GetRelativeDirectionToOutside()

static Vector3i cBlockDoorHandler::GetRelativeDirectionToOutside ( NIBBLETYPE  a_BlockMeta)
inlinestatic

Returns a vector pointing one block in the direction the door is facing (where the outside is).

Definition at line 49 of file BlockDoor.h.

◆ IsDoorBlockType()

static bool cBlockDoorHandler::IsDoorBlockType ( BLOCKTYPE  a_Block)
inlinestatic

Returns true if the specified blocktype is any kind of door.

Definition at line 61 of file BlockDoor.h.

◆ IsOpen()

static bool cBlockDoorHandler::IsOpen ( cChunkInterface a_ChunkInterface,
const Vector3i  a_BlockPos 
)
inlinestatic

Returns true iff the door at the specified coords is open.

The coords may point to either the top part or the bottom part of the door.

Definition at line 84 of file BlockDoor.h.

◆ IsUseable()

virtual bool cBlockDoorHandler::IsUseable ( void  ) const
inlineoverrideprivatevirtual

Definition at line 182 of file BlockDoor.h.

◆ MetaMirrorXY()

NIBBLETYPE cBlockDoorHandler::MetaMirrorXY ( NIBBLETYPE  a_Meta) const
overrideprivatevirtual

◆ MetaMirrorYZ()

NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ ( NIBBLETYPE  a_Meta) const
overrideprivatevirtual

◆ MetaRotateCCW()

NIBBLETYPE cBlockDoorHandler::MetaRotateCCW ( NIBBLETYPE  a_Meta) const
overrideprivatevirtual

◆ MetaRotateCW()

NIBBLETYPE cBlockDoorHandler::MetaRotateCW ( NIBBLETYPE  a_Meta) const
overrideprivatevirtual

◆ OnBroken()

void cBlockDoorHandler::OnBroken ( cChunkInterface a_ChunkInterface,
cWorldInterface a_WorldInterface,
Vector3i  a_BlockPos,
BLOCKTYPE  a_OldBlockType,
NIBBLETYPE  a_OldBlockMeta,
const cEntity a_Digger 
) const
overrideprivatevirtual

Definition at line 10 of file BlockDoor.cpp.

◆ OnCancelRightClick()

void cBlockDoorHandler::OnCancelRightClick ( cChunkInterface a_ChunkInterface,
cWorldInterface a_WorldInterface,
cPlayer a_Player,
const Vector3i  a_BlockPos,
eBlockFace  a_BlockFace 
) const
overrideprivatevirtual

Definition at line 92 of file BlockDoor.cpp.

◆ OnUse()

bool cBlockDoorHandler::OnUse ( cChunkInterface a_ChunkInterface,
cWorldInterface a_WorldInterface,
cPlayer a_Player,
const Vector3i  a_BlockPos,
eBlockFace  a_BlockFace,
const Vector3i  a_CursorPos 
) const
overrideprivatevirtual

Definition at line 45 of file BlockDoor.cpp.

◆ SetOpen()

static void cBlockDoorHandler::SetOpen ( cChunkInterface a_ChunkInterface,
const Vector3i  a_BlockPos,
bool  a_Open 
)
inlinestatic

Sets the door to the specified state.

If the door is already in that state, does nothing.

Definition at line 91 of file BlockDoor.h.


The documentation for this class was generated from the following files: