5 #include "../Entities/Player.h"
6 #include "../ClientHandle.h"
43 switch (EquippedItem.m_ItemType)
89 if ((Meta < 3) && (EquippedItem.m_ItemDamage == 0))
106 if ((Meta > 0) && ((EquippedItem.m_ItemColor.GetRed() != 255) || (EquippedItem.m_ItemColor.GetBlue() != 255) || (EquippedItem.m_ItemColor.GetGreen() != 255)))
109 auto NewItem =
cItem(EquippedItem);
110 NewItem.m_ItemColor.Clear();
141 auto NewShulker =
cItem(EquippedItem);
149 if (!EquippedItem.GetHandler().IsPlaceable())
160 a_ChunkInterface.
GetBlock(ResendPosition),
195 auto Meta = a_Chunk.
GetMeta(a_RelPos);
198 a_Chunk.
SetMeta(a_RelPos, Meta + 1);
@ E_BLOCK_PINK_SHULKER_BOX
@ E_BLOCK_BLUE_SHULKER_BOX
@ E_BLOCK_BROWN_SHULKER_BOX
@ E_BLOCK_LIGHT_BLUE_SHULKER_BOX
@ E_BLOCK_MAGENTA_SHULKER_BOX
@ E_BLOCK_CYAN_SHULKER_BOX
@ E_BLOCK_LIME_SHULKER_BOX
@ E_BLOCK_PURPLE_SHULKER_BOX
@ E_BLOCK_ORANGE_SHULKER_BOX
@ E_BLOCK_GRAY_SHULKER_BOX
@ E_BLOCK_YELLOW_SHULKER_BOX
@ E_BLOCK_GREEN_SHULKER_BOX
@ E_BLOCK_BLACK_SHULKER_BOX
@ E_BLOCK_LIGHT_GRAY_SHULKER_BOX
@ E_BLOCK_RED_SHULKER_BOX
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
void AddFaceDirection(int &a_BlockX, int &a_BlockY, int &a_BlockZ, eBlockFace a_BlockFace, bool a_bInverse)
Modifies the specified coords so that they point to the block adjacent to the one specified through i...
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
virtual bool IsUseable() const override
Called to check whether this block supports a rclk action.
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
Called when the user right clicks the block and the block is useable.
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem *const a_Tool) const override
Returns the pickups that would result if the block was mined by a_Digger using a_Tool.
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
Returns the base colour ID of the block, as will be represented on a map, as per documentation: https...
virtual void OnUpdate(cChunkInterface &a_ChunkInterface, cWorldInterface &a_WorldInterface, cBlockPluginInterface &a_PluginInterface, cChunk &a_Chunk, const Vector3i a_RelPos) const override
Called when the block gets ticked either by a random tick or by a queued tick.
constexpr cBlockHandler(BLOCKTYPE a_BlockType)
This interface is used to decouple block handlers from the cPluginManager dependency through cWorld.
void SetBlockMeta(Vector3i a_BlockPos, NIBBLETYPE a_MetaData)
Sets the meta for the specified block, while keeping the blocktype.
NIBBLETYPE GetBlockMeta(Vector3i a_Pos)
BLOCKTYPE GetBlock(Vector3i a_Pos)
virtual bool IsWeatherWetAtXYZ(Vector3i a_Pos)=0
Returns true if it is raining or storming at the specified location, and the rain reaches the specifi...
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition) const
Converts the coord relative to this chunk into an absolute coord.
void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
void SendBlockChange(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
cClientHandle * GetClientHandle(void) const
StatisticsManager & GetStatistics()
Return the associated statistic and achievement manager.
const cItem & GetEquippedItem(void) const
bool IsGameModeCreative(void) const
Returns true if the player is in Creative mode, either explicitly, or by inheriting from current worl...
void ReplaceOneEquippedItemTossRest(const cItem &)
Removes one item from the the current equipped item stack, and attempts to add the specified item sta...
This class bridges a vector of cItem for safe access via Lua.
std::unordered_map< CustomStatistic, StatValue > Custom