4 #include "../../BlockEntities/HopperEntity.h"
27 const bool ShouldBeLocked =
Power != 0;
28 const bool PreviouslyLocked = (a_Meta & 0x8) == 0x8;
30 if (ShouldBeLocked == PreviouslyLocked)
37 a_Chunk.
SetMeta(a_Position, a_Meta | 0x8);
41 a_Chunk.
SetMeta(a_Position, a_Meta & ~0x8);
48 static_cast<cHopperEntity &
>(a_BlockEntity).SetLocked(ShouldBeLocked);
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
constexpr std::array< Vector3i, 6 > RelativeAdjacents
void InvokeForAdjustedRelatives(ForEachSourceCallback &Callback, const Vector3i Position, const ArrayType &Relative)
unsigned char Power(const BlockState Block)
static void ForValidSourcePositions(const cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback &Callback)
static PowerLevel GetPowerDeliveredToPosition(const cChunk &a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
static void Update(cChunk &a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
BLOCKTYPE GetBlockType() const
bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback)
Calls the callback for the block entity at the specified coords; returns false if there's no block en...
void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)