Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | List of all members
cBlockEndPortalFrameHandler Class Reference

#include <BlockEndPortalFrame.h>

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

Public Member Functions

 cBlockEndPortalFrameHandler (BLOCKTYPE a_BlockType)
 
bool FindAndSetPortal (Vector3i a_FirstFrame, NIBBLETYPE a_Direction, cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface)
 Returns false if portal cannot be made, true if portal was made. More...
 
virtual ColourID GetMapBaseColourID (NIBBLETYPE a_Meta) override
 Returns the base colour ID of the block, as will be represented on a map, as per documentation: https://minecraft.gamepedia.com/Map_item_format. More...
 
virtual bool GetPlacementBlockTypeMeta (cChunkInterface &a_ChunkInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) override
 Called before a block is placed into a world. More...
 
virtual bool IsClickedThrough (void) override
 Indicates whether the client will click through this block. More...
 
bool IsPortalFrame (BLOCKTYPE BlockType)
 Return true if this block is a portal frame. More...
 
bool IsValidFrameAtPos (cChunkInterface &a_ChunkInterface, Vector3i a_BlockPos, NIBBLETYPE a_ShouldFace)
 Return true if this block is a portal frame, has an eye, and is facing the correct direction. More...
 
virtual void OnPlaced (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override
 Called by cWorld::SetBlock() after the block has been set. More...
 
- Public Member Functions inherited from cMetaRotator< cBlockHandler, 0x03, E_META_END_PORTAL_FRAME_ZM, E_META_END_PORTAL_FRAME_XP, E_META_END_PORTAL_FRAME_ZP, E_META_END_PORTAL_FRAME_XM >
 cMetaRotator (BLOCKTYPE a_BlockType)
 
virtual NIBBLETYPE MetaMirrorXY (NIBBLETYPE a_Meta) override
 
virtual NIBBLETYPE MetaMirrorYZ (NIBBLETYPE a_Meta) override
 
virtual NIBBLETYPE MetaRotateCCW (NIBBLETYPE a_Meta) override
 
virtual NIBBLETYPE MetaRotateCW (NIBBLETYPE a_Meta) override
 
- Public Member Functions inherited from cBlockHandler
virtual bool CanBeAt (cChunkInterface &a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk &a_Chunk)
 Checks if the block can stay at the specified relative coords in the chunk. More...
 
virtual bool CanSustainPlant (BLOCKTYPE a_Plant)
 Checks whether the block has an effect on growing the plant. More...
 
 cBlockHandler (BLOCKTYPE a_BlockType)
 
virtual void Check (cChunkInterface &ChunkInterface, cBlockPluginInterface &a_PluginInterface, Vector3i a_RelPos, cChunk &a_Chunk)
 Called when one of the neighbors gets set; equivalent to MC block update. More...
 
virtual cItems ConvertToPickups (NIBBLETYPE a_BlockMeta, cBlockEntity *a_BlockEntity, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
 Returns the pickups that would result if the block was mined by a_Digger using a_Tool. More...
 
virtual bool DoesDropOnUnsuitable (void)
 Returns if this block drops if it gets destroyed by an unsuitable situation. More...
 
virtual bool DoesIgnoreBuildCollision (cChunkInterface &ChunkInterface, Vector3i a_Pos, cPlayer &a_Player, NIBBLETYPE a_Meta)
 Checks if the player can build "inside" this block. More...
 
virtual cBoundingBox GetPlacementCollisionBox (BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP)
 Returns the relative bounding box that must be entity-free in order for the block to be placed. More...
 
virtual int Grow (cChunk &a_Chunk, Vector3i a_RelPos, int a_NumStages=1)
 Grows this block, if it supports growing, by the specified amount of stages (at most). More...
 
virtual bool IsInsideBlock (Vector3d a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta)
 Tests if a_Position is inside the block where a_Position is relative to the origin of the block Note that this is considered from a "top-down" perspective i.e. More...
 
virtual bool IsUseable (void)
 Checks if the block can be placed at this point. More...
 
virtual NIBBLETYPE MetaMirrorXZ (NIBBLETYPE a_Meta)
 Mirros a given block meta around the XZ plane. More...
 
virtual void OnBreaking (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos)
 Called before a block gets broken (replaced with air), either by player or by natural means. More...
 
virtual void OnBroken (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta)
 Called after a block gets broken (replaced with air), either by player or by natural means. More...
 
virtual void OnCancelRightClick (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace)
 Called when a right click to this block is cancelled. More...
 
virtual void OnDigging (cChunkInterface &cChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
 Called when the player starts digging the block. More...
 
virtual void OnNeighborChanged (cChunkInterface &a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
 Called when a direct neighbor of this block has been changed. More...
 
virtual void OnPlacedByPlayer (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const sSetBlock &a_BlockChange)
 Called by cPlayer::PlaceBlocks() for each block after it has been set to the world. More...
 
virtual void OnPlayerBreakingBlock (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, Vector3i a_BlockPos)
 Called just before the player breaks the block. More...
 
virtual void OnPlayerBrokeBlock (cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta)
 Called just after the player breaks the block. More...
 
virtual void OnUpdate (cChunkInterface &cChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_BlockPluginInterface, cChunk &a_Chunk, int a_RelX, int a_RelY, int a_RelZ)
 Called when the block gets ticked either by a random tick or by a queued tick. More...
 
virtual bool 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)
 Called if the user right clicks the block and the block is useable returns true if the use was successful, return false to use the block as a "normal" block. More...
 
virtual ~cBlockHandler ()
 

Static Public Member Functions

static NIBBLETYPE YawToMetaData (double a_Rotation)
 
- Static Public Member Functions inherited from cBlockHandler
static void NeighborChanged (cChunkInterface &a_ChunkInterface, Vector3i a_NeighborPos, eBlockFace a_WhichNeighbor)
 Notifies the specified neighbor that the current block has changed. More...
 
static bool ToolHasSilkTouch (const cItem *a_Tool)
 Returns true if the specified tool is valid and has a non-zero silk-touch enchantment. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from cBlockHandler
static cBlockHandlerCreateBlockHandler (BLOCKTYPE a_BlockType)
 
- Protected Attributes inherited from cBlockHandler
BLOCKTYPE m_BlockType
 

Detailed Description

Definition at line 10 of file BlockEndPortalFrame.h.

Constructor & Destructor Documentation

cBlockEndPortalFrameHandler::cBlockEndPortalFrameHandler ( BLOCKTYPE  a_BlockType)
inline

Definition at line 19 of file BlockEndPortalFrame.h.

Member Function Documentation

bool cBlockEndPortalFrameHandler::FindAndSetPortal ( Vector3i  a_FirstFrame,
NIBBLETYPE  a_Direction,
cChunkInterface a_ChunkInterface,
cWorldInterface a_WorldInterface 
)
inline

Returns false if portal cannot be made, true if portal was made.

Definition at line 96 of file BlockEndPortalFrame.h.

virtual ColourID cBlockEndPortalFrameHandler::GetMapBaseColourID ( NIBBLETYPE  a_Meta)
inlineoverridevirtual

Returns the base colour ID of the block, as will be represented on a map, as per documentation: https://minecraft.gamepedia.com/Map_item_format.

Reimplemented from cBlockHandler.

Definition at line 249 of file BlockEndPortalFrame.h.

virtual bool cBlockEndPortalFrameHandler::GetPlacementBlockTypeMeta ( cChunkInterface a_ChunkInterface,
cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ,
BLOCKTYPE a_BlockType,
NIBBLETYPE a_BlockMeta 
)
inlineoverridevirtual

Called before a block is placed into a world.

The handler should return true to allow placement, false to refuse. Also, the handler should set a_BlockType and a_BlockMeta to correct values for the newly placed block. Called by cItemHandler::GetPlacementBlockTypeMeta() if the item is a block

Reimplemented from cBlockHandler.

Definition at line 33 of file BlockEndPortalFrame.h.

virtual bool cBlockEndPortalFrameHandler::IsClickedThrough ( void  )
inlineoverridevirtual

Indicates whether the client will click through this block.

For example digging a fire will hit the block below the fire so fire is clicked through

Reimplemented from cBlockHandler.

Definition at line 239 of file BlockEndPortalFrame.h.

bool cBlockEndPortalFrameHandler::IsPortalFrame ( BLOCKTYPE  BlockType)
inline

Return true if this block is a portal frame.

Definition at line 230 of file BlockEndPortalFrame.h.

bool cBlockEndPortalFrameHandler::IsValidFrameAtPos ( cChunkInterface a_ChunkInterface,
Vector3i  a_BlockPos,
NIBBLETYPE  a_ShouldFace 
)
inline

Return true if this block is a portal frame, has an eye, and is facing the correct direction.

Definition at line 214 of file BlockEndPortalFrame.h.

virtual void cBlockEndPortalFrameHandler::OnPlaced ( cChunkInterface a_ChunkInterface,
cWorldInterface a_WorldInterface,
Vector3i  a_BlockPos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
inlineoverridevirtual

Called by cWorld::SetBlock() after the block has been set.

Reimplemented from cBlockHandler.

Definition at line 79 of file BlockEndPortalFrame.h.

static NIBBLETYPE cBlockEndPortalFrameHandler::YawToMetaData ( double  a_Rotation)
inlinestatic

Definition at line 49 of file BlockEndPortalFrame.h.


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