4 #include "../../Blocks/BlockTripwireHook.h"
14 bool FoundActivated =
false;
17 for (
int i = 0; i < 40; ++i)
42 FoundActivated =
true;
52 return FoundActivated ? 15 : 1;
80 Meta = (a_Meta & 0x3);
85 Meta = (a_Meta & 0x7) | 0x4;
90 Meta = (a_Meta | 0xC);
94 UNREACHABLE(
"Unexpected tripwire hook power level!");
99 a_Chunk.
SetMeta(a_Position, Meta);
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eBlockFace ReverseBlockFace(eBlockFace a_BlockFace)
Returns a blockface opposite to the one specified.
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...
constexpr std::array< Vector3i, 6 > RelativeAdjacents
void UpdateAdjustedRelatives(const cChunk &a_Chunk, const cChunk &a_TickingChunk, const Vector3i a_Position, const ArrayType &a_Relative)
Vector3< double > Vector3d
unsigned char Power(const BlockState Block)
static void Update(cChunk &a_Chunk, cChunk &CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
static unsigned char GetPowerLevel(const cChunk &a_Chunk, Vector3i a_Position, NIBBLETYPE a_Meta)
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 eBlockFace MetadataToDirection(NIBBLETYPE a_Meta)
Represents two sets of coords, minimum and maximum for each direction.
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
cChunkCoords GetPos() const
bool ForEachEntityInBox(const cBoundingBox &a_Box, cEntityCallback a_Callback) const
Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.
bool UnboundedRelGetBlock(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
static Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition, cChunkCoords a_ChunkCoords)
Converts relative block coordinates into absolute coordinates with a known chunk location.