Cuberite
A lightweight, fast and extensible game server for Minecraft
|
#include <BlockPiston.h>
Static Public Member Functions | |
static void | ExtendPiston (Vector3i a_BlockPos, cWorld &a_World) |
static bool | IsExtended (NIBBLETYPE a_PistonMeta) |
Returns true if the piston (with the specified meta) is extended. More... | |
static eBlockFace | MetaDataToDirection (NIBBLETYPE a_MetaData) |
static Vector3i | MetadataToOffset (NIBBLETYPE a_PistonMeta) |
Converts piston block's metadata into a unit vector representing the direction in which the piston will extend. More... | |
static void | RetractPiston (Vector3i a_BlockPos, cWorld &a_World) |
Static Public Member Functions inherited from cDisplacementYawRotator< Base, BitMask, North, East, South, West, Up, Down > | |
static NIBBLETYPE | DisplacementYawToMetaData (const Vector3d a_PlacePosition, const Vector3d a_EyePosition, const double a_Rotation) |
Converts the placement position, eye position as returned by cPlayer::GetEyePosition(), and rotation value as returned by cPlayer::GetYaw() to the appropriate metadata value for a block placed by a player facing that way. More... | |
Static Public Member Functions inherited from cYawRotator< Base, 0x07, 0x02, 0x05, 0x03, 0x04 > | |
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 = cClearMetaOnDrop< cDisplacementYawRotator< cBlockHandler, 0x07, 0x03, 0x04, 0x02, 0x05, 0x01, 0x00 > > |
typedef std::unordered_set< Vector3i, VectorHasher< int > > | Vector3iSet |
Private Member Functions | |
virtual ColourID | GetMapBaseColourID (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 |
Static Private Member Functions | |
static bool | CanPush (BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) |
Returns true if the specified block can be pushed by a piston (and left intact) More... | |
static bool | CanPushBlock (const Vector3i &a_BlockPos, cWorld &a_World, bool a_RequirePushable, Vector3iSet &a_BlocksPushed, const Vector3i &a_PushDir) |
Tries to push a block and increases the pushed blocks variable. More... | |
static bool | IsSticky (BLOCKTYPE a_BlockType) |
Returns true if the piston (specified by blocktype) is a sticky piston. More... | |
static void | PushBlocks (const Vector3iSet &a_BlocksToPush, cWorld &a_World, const Vector3i &a_PushDir) |
Moves a list of blocks in a specific direction. More... | |
Static Private Attributes | |
static const Byte | PistonExtendAction = 0U |
Piston extension block action. More... | |
static const Byte | PistonRetractAction = 1U |
Piston retraction block action. More... | |
Definition at line 18 of file BlockPiston.h.
|
private |
Definition at line 21 of file BlockPiston.h.
|
private |
Definition at line 56 of file BlockPiston.h.
|
inlinestaticprivate |
Returns true if the specified block can be pushed by a piston (and left intact)
Definition at line 68 of file BlockPiston.h.
|
staticprivate |
Tries to push a block and increases the pushed blocks variable.
Returns true if the block is pushable
Definition at line 213 of file BlockPiston.cpp.
Definition at line 44 of file BlockPiston.cpp.
|
inlineoverrideprivatevirtual |
Definition at line 122 of file BlockPiston.h.
|
inlinestatic |
Returns true if the piston (with the specified meta) is extended.
Definition at line 52 of file BlockPiston.h.
|
inlinestaticprivate |
Returns true if the piston (specified by blocktype) is a sticky piston.
Definition at line 65 of file BlockPiston.h.
|
inlinestatic |
Definition at line 27 of file BlockPiston.h.
|
static |
Converts piston block's metadata into a unit vector representing the direction in which the piston will extend.
Definition at line 21 of file BlockPiston.cpp.
|
overrideprivatevirtual |
Definition at line 287 of file BlockPiston.cpp.
|
staticprivate |
Moves a list of blocks in a specific direction.
Definition at line 174 of file BlockPiston.cpp.
Definition at line 102 of file BlockPiston.cpp.
|
staticprivate |
Piston extension block action.
Definition at line 59 of file BlockPiston.h.
|
staticprivate |
Piston retraction block action.
Definition at line 62 of file BlockPiston.h.