Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <BlockButton.h>
Static Public Member Functions | |
static bool | IsButtonOn (NIBBLETYPE a_Meta) |
Extracts the ON bit from metadata and returns if true if it is set. More... | |
static void | OnArrowHit (cWorld &a_World, const Vector3i a_Position, const eBlockFace a_HitFace) |
Event handler for an arrow striking a block. More... | |
Private Types | |
using | Super = cClearMetaOnDrop< cMetaRotator< cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true > > |
Private Member Functions | |
virtual bool | CanBeAt (const cChunk &a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override |
virtual ColourID | GetMapBaseColourID (NIBBLETYPE a_Meta) const override |
virtual bool | IsUseable (void) 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 eBlockFace | BlockMetaDataToBlockFace (NIBBLETYPE a_Meta) |
Converts the block meta of this button into a block face of the neighbor to which the button is attached. More... | |
static Vector3d | GetButtonOffsetOnBlock (NIBBLETYPE a_Meta) |
Returns an offset to the integer world coordinates of a button. More... | |
static bool | IsButtonPressedByArrow (cWorld &a_World, const Vector3i a_ButtonPosition, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_Meta) |
Returns true if an arrow was found in the wooden button. More... | |
static void | QueueButtonRelease (cWorld &a_ButtonWorld, const Vector3i a_Position, const BLOCKTYPE a_BlockType) |
Schedules a recurring event at appropriate intervals to release a button at a given position. More... | |
Additional Inherited Members | |
Public Member Functions inherited from cClearMetaOnDrop< cMetaRotator< cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true > > | |
constexpr | cClearMetaOnDrop (BLOCKTYPE a_BlockType) |
Public Member Functions inherited from cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched > | |
constexpr | cMetaRotator (BLOCKTYPE a_BlockType) |
Protected Member Functions inherited from cClearMetaOnDrop< cMetaRotator< cBlockHandler, 0x07, 0x04, 0x01, 0x03, 0x02, true > > | |
~cClearMetaOnDrop ()=default | |
Protected Member Functions inherited from cMetaRotator< Base, BitMask, North, East, South, West, AssertIfNotMatched > | |
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 |
~cMetaRotator ()=default | |
Definition at line 17 of file BlockButton.h.
|
private |
Definition at line 20 of file BlockButton.h.
|
inlinestaticprivate |
Converts the block meta of this button into a block face of the neighbor to which the button is attached.
Definition at line 110 of file BlockButton.h.
|
inlineoverrideprivatevirtual |
Definition at line 132 of file BlockButton.h.
|
inlinestaticprivate |
Returns an offset to the integer world coordinates of a button.
Applying this offset yields the centre of the button's bounding box, in terms of the position within the block the button with given meta occupies.
TODO: this is only approximate, return the exact bbox instead.
Definition at line 248 of file BlockButton.h.
|
inlineoverrideprivatevirtual |
Definition at line 179 of file BlockButton.h.
|
inlinestatic |
Extracts the ON bit from metadata and returns if true if it is set.
Definition at line 27 of file BlockButton.h.
|
inlinestaticprivate |
Returns true if an arrow was found in the wooden button.
Definition at line 224 of file BlockButton.h.
|
inlineoverrideprivatevirtual |
Definition at line 100 of file BlockButton.h.
|
inlinestatic |
Event handler for an arrow striking a block.
Performs appropriate handling if the arrow intersected a wooden button.
Definition at line 34 of file BlockButton.h.
|
inlineoverrideprivatevirtual |
Definition at line 64 of file BlockButton.h.
|
inlinestaticprivate |
Schedules a recurring event at appropriate intervals to release a button at a given position.
The given block type is checked when the task is executed to ensure the position still contains a button.
Definition at line 187 of file BlockButton.h.