8 #include "../Entities/Player.h"
10 #include "../BoundingBox.h"
11 #include "../Mobs/Monster.h"
26 if ((a_OldBlockMeta & 0x08) != 0)
72 auto PosCopy = a_BlockPos;
79 if ((Meta & 0x8) == 0)
107 if ((Meta & 0x04) == 0x04)
117 return a_Entity.IsMob() && (static_cast<cMonster&>(a_Entity).GetMobFamily() == cMonster::mfHostile);
143 if (a_WorldInterface.
ForEachPlayer([](
cPlayer & a_OtherPlayer) { return !a_OtherPlayer.IsInBed(); }))
147 VacateBed(a_ChunkInterface, a_OtherPlayer);
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.
Vector3< float > Vector3f
static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData)
virtual void OnBroken(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, const Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta, const cEntity *a_Digger) const override
virtual bool OnUse(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cPlayer &a_Player, const Vector3i a_ClickedBlockPos, eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPos) const override
static void VacateBed(cChunkInterface &a_ChunkInterface, cPlayer &a_Player)
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, const cItem *a_Tool) const override
bool GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta)
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData)
Sets the meta for the specified block, while keeping the blocktype.
void SetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Sets the block at the specified coords to the specified value.
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
BLOCKTYPE GetBlock(Vector3i a_Pos)
void FastSetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Sets the block at the specified coords to the specified value.
virtual cTickTime GetTimeOfDay(void) const =0
virtual void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void *a_SourceData)=0
virtual void SetTimeOfDay(cTickTime a_TimeOfDay)=0
virtual bool ForEachPlayer(cPlayerListCallback a_Callback)=0
Calls the callback for each player in the list; returns true if all players processed,...
virtual eDimension GetDimension(void) const =0
void SetPosition(double a_PosX, double a_PosY, double a_PosZ)
cWorld * GetWorld(void) const
void SendAboveActionBarMessage(const AString &a_Message)
StatisticsManager & GetStatistics()
Return the associated statistic and achievement manager.
void SetBedPos(Vector3i a_Position)
Sets the player's bed position to the specified position.
bool IsInBed(void) const
Returns true if a player is sleeping in a bed.
void SetIsInBed(bool a_IsInBed)
Sets a player's in-bed state.
This class bridges a vector of cItem for safe access via Lua.
std::unordered_map< CustomStatistic, StatValue > Custom
virtual bool ForEachEntityInBox(const cBoundingBox &a_Box, cEntityCallback a_Callback) override
Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.
eWeather GetWeather(void) const
Returns the current weather.