1
0

Redstone: inline -> static

This commit is contained in:
Tiger Wang 2021-01-21 22:51:55 +00:00
parent 4f3b699b27
commit 19302eeb87
21 changed files with 89 additions and 89 deletions

View File

@ -9,7 +9,7 @@
namespace CommandBlockHandler namespace CommandBlockHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -20,7 +20,7 @@ namespace CommandBlockHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating commander the cmdblck (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating commander the cmdblck (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -38,7 +38,7 @@ namespace CommandBlockHandler
}); });
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,7 +9,7 @@
namespace DaylightSensorHandler namespace DaylightSensorHandler
{ {
inline PowerLevel GetPowerLevel(const cChunk & a_Chunk, const Vector3i a_Position) static PowerLevel GetPowerLevel(const cChunk & a_Chunk, const Vector3i a_Position)
{ {
if (a_Chunk.GetBlock(a_Position) == E_BLOCK_INVERTED_DAYLIGHT_SENSOR) if (a_Chunk.GetBlock(a_Position) == E_BLOCK_INVERTED_DAYLIGHT_SENSOR)
{ {
@ -27,7 +27,7 @@ namespace DaylightSensorHandler
return static_cast<PowerLevel>(std::clamp(RawOutput, 0.f, 15.f)); return static_cast<PowerLevel>(std::clamp(RawOutput, 0.f, 15.f));
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);
@ -37,7 +37,7 @@ namespace DaylightSensorHandler
return IsLinked ? 0 : a_Chunk.GetMeta(a_Position); return IsLinked ? 0 : a_Chunk.GetMeta(a_Position);
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating Darryl the daylight sensor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating Darryl the daylight sensor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -52,7 +52,7 @@ namespace DaylightSensorHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -11,7 +11,7 @@ namespace DoorHandler
{ {
// "Doormammu, I've come to bargain" // "Doormammu, I've come to bargain"
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -22,7 +22,7 @@ namespace DoorHandler
return 0; return 0;
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);
@ -30,7 +30,7 @@ namespace DoorHandler
InvokeForAdjustedRelatives(Callback, a_Position, RelativeAdjacents); InvokeForAdjustedRelatives(Callback, a_Position, RelativeAdjacents);
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PowerLevel Power)
{ {
// LOGD("Evaluating dori the door (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating dori the door (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);

View File

@ -9,12 +9,12 @@
namespace DropSpenserHandler namespace DropSpenserHandler
{ {
inline bool IsActivated(NIBBLETYPE a_Meta) static bool IsActivated(NIBBLETYPE a_Meta)
{ {
return (a_Meta & E_META_DROPSPENSER_ACTIVATED) != 0; return (a_Meta & E_META_DROPSPENSER_ACTIVATED) != 0;
} }
inline NIBBLETYPE SetActivationState(NIBBLETYPE a_Meta, bool IsOn) static NIBBLETYPE SetActivationState(NIBBLETYPE a_Meta, bool IsOn)
{ {
if (IsOn) if (IsOn)
{ {
@ -26,7 +26,7 @@ namespace DropSpenserHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -37,7 +37,7 @@ namespace DropSpenserHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating spencer the dropspenser (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating spencer the dropspenser (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -60,7 +60,7 @@ namespace DropSpenserHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,7 +9,7 @@
namespace HopperHandler namespace HopperHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -20,7 +20,7 @@ namespace HopperHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating holey the hopper (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating holey the hopper (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -37,7 +37,7 @@ namespace HopperHandler
}); });
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,7 +9,7 @@
namespace NoteBlockHandler namespace NoteBlockHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -20,7 +20,7 @@ namespace NoteBlockHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating sparky the magical note block (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power); // LOGD("Evaluating sparky the magical note block (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power);
@ -38,7 +38,7 @@ namespace NoteBlockHandler
}); });
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,12 +9,12 @@
namespace ObserverHandler namespace ObserverHandler
{ {
inline bool IsOn(NIBBLETYPE a_Meta) static bool IsOn(NIBBLETYPE a_Meta)
{ {
return (a_Meta & 0x8) == 0x8; return (a_Meta & 0x8) == 0x8;
} }
inline bool ShouldPowerOn(cChunk & Chunk, const Vector3i a_Position, NIBBLETYPE a_Meta, cIncrementalRedstoneSimulatorChunkData & a_Data) static bool ShouldPowerOn(cChunk & Chunk, const Vector3i a_Position, NIBBLETYPE a_Meta, cIncrementalRedstoneSimulatorChunkData & a_Data)
{ {
BLOCKTYPE BlockType; BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta; NIBBLETYPE BlockMeta;
@ -46,13 +46,13 @@ namespace ObserverHandler
return Previous != Observed; return Previous != Observed;
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
const auto Meta = a_Chunk.GetMeta(a_Position); const auto Meta = a_Chunk.GetMeta(a_Position);
return (IsOn(Meta) && (a_QueryPosition == (a_Position + cBlockObserverHandler::GetSignalOutputOffset(Meta)))) ? 15 : 0; return (IsOn(Meta) && (a_QueryPosition == (a_Position + cBlockObserverHandler::GetSignalOutputOffset(Meta)))) ? 15 : 0;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating Lenny the observer (%i %i %i)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating Lenny the observer (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
@ -98,7 +98,7 @@ namespace ObserverHandler
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockObserverHandler::GetSignalOutputOffset(a_Meta)); UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockObserverHandler::GetSignalOutputOffset(a_Meta));
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -9,7 +9,7 @@
namespace PistonHandler namespace PistonHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -20,7 +20,7 @@ namespace PistonHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating pisty the piston (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating pisty the piston (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -45,7 +45,7 @@ namespace PistonHandler
// However, this delay is already present: as a side effect of the implementation of piston animation in Blocks\BlockPiston.cpp // However, this delay is already present: as a side effect of the implementation of piston animation in Blocks\BlockPiston.cpp
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,7 +9,7 @@ namespace PoweredRailHandler
{ {
/** Get the offset along which the rail faces. /** Get the offset along which the rail faces.
Not in cBlockRailHandler since specific to powered rails. */ Not in cBlockRailHandler since specific to powered rails. */
inline Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta) static Vector3i GetPoweredRailAdjacentXZCoordinateOffset(NIBBLETYPE a_Meta)
{ {
switch (a_Meta & 0x7) switch (a_Meta & 0x7)
{ {
@ -27,7 +27,7 @@ namespace PoweredRailHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_QueryBlockType); UNUSED(a_QueryBlockType);
@ -41,7 +41,7 @@ namespace PoweredRailHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTickingChunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating tracky the rail (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating tracky the rail (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -78,7 +78,7 @@ namespace PoweredRailHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Meta); UNUSED(a_Meta);

View File

@ -10,7 +10,7 @@
namespace PressurePlateHandler namespace PressurePlateHandler
{ {
inline unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType) static unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType)
{ {
size_t NumberOfEntities = 0; size_t NumberOfEntities = 0;
bool FoundPlayer = false; bool FoundPlayer = false;
@ -58,7 +58,7 @@ namespace PressurePlateHandler
} }
} }
inline const char * GetClickOnSound(BLOCKTYPE a_BlockType) static const char * GetClickOnSound(BLOCKTYPE a_BlockType)
{ {
// manage on-sound // manage on-sound
switch (a_BlockType) switch (a_BlockType)
@ -75,7 +75,7 @@ namespace PressurePlateHandler
} }
} }
inline const char * GetClickOffSound(BLOCKTYPE a_BlockType) static const char * GetClickOffSound(BLOCKTYPE a_BlockType)
{ {
// manage off-sound // manage off-sound
switch (a_BlockType) switch (a_BlockType)
@ -92,7 +92,7 @@ namespace PressurePlateHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_BlockType); UNUSED(a_BlockType);
UNUSED(a_QueryPosition); UNUSED(a_QueryPosition);
@ -103,7 +103,7 @@ namespace PressurePlateHandler
return (IsLinked && (a_QueryPosition != (a_Position + OffsetYM))) ? 0 : DataForChunk(a_Chunk).GetCachedPowerData(a_Position); return (IsLinked && (a_QueryPosition != (a_Position + OffsetYM))) ? 0 : DataForChunk(a_Chunk).GetCachedPowerData(a_Position);
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating clicky the pressure plate (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating clicky the pressure plate (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -205,7 +205,7 @@ namespace PressurePlateHandler
UpdateAdjustedRelatives(a_Chunk, CurrentlyTicking, a_Position, RelativeAdjacents); UpdateAdjustedRelatives(a_Chunk, CurrentlyTicking, a_Position, RelativeAdjacents);
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -7,7 +7,7 @@
namespace RedstoneBlockHandler namespace RedstoneBlockHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -17,12 +17,12 @@ namespace RedstoneBlockHandler
return IsLinked ? 0 : 15; return IsLinked ? 0 : 15;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating crimson the redstone block (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating crimson the redstone block (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -9,7 +9,7 @@
namespace RedstoneComparatorHandler namespace RedstoneComparatorHandler
{ {
inline unsigned char GetFrontPowerLevel(NIBBLETYPE a_Meta, unsigned char a_HighestSidePowerLevel, unsigned char a_HighestRearPowerLevel) static unsigned char GetFrontPowerLevel(NIBBLETYPE a_Meta, unsigned char a_HighestSidePowerLevel, unsigned char a_HighestRearPowerLevel)
{ {
if (cBlockComparatorHandler::IsInSubtractionMode(a_Meta)) if (cBlockComparatorHandler::IsInSubtractionMode(a_Meta))
{ {
@ -23,7 +23,7 @@ namespace RedstoneComparatorHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_QueryPosition); UNUSED(a_QueryPosition);
UNUSED(a_QueryBlockType); UNUSED(a_QueryBlockType);
@ -35,7 +35,7 @@ namespace RedstoneComparatorHandler
); );
} }
inline unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta) static unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta)
{ {
UInt8 SignalStrength = 0; UInt8 SignalStrength = 0;
auto RearCoordinate = cBlockComparatorHandler::GetRearCoordinate(Position, Meta & 0x3); auto RearCoordinate = cBlockComparatorHandler::GetRearCoordinate(Position, Meta & 0x3);
@ -79,7 +79,7 @@ namespace RedstoneComparatorHandler
); );
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// Note that Power here contains the maximum * side * power level, as specified by GetValidSourcePositions // Note that Power here contains the maximum * side * power level, as specified by GetValidSourcePositions
// LOGD("Evaluating ALU the comparator (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating ALU the comparator (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -125,7 +125,7 @@ namespace RedstoneComparatorHandler
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockComparatorHandler::GetFrontCoordinate(a_Position, a_Meta & 0x3) - a_Position); UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockComparatorHandler::GetFrontCoordinate(a_Position, a_Meta & 0x3) - a_Position);
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -7,17 +7,17 @@
namespace RedstoneLampHandler namespace RedstoneLampHandler
{ {
inline bool IsOn(BLOCKTYPE a_BlockType) static bool IsOn(BLOCKTYPE a_BlockType)
{ {
return (a_BlockType == E_BLOCK_REDSTONE_LAMP_ON); return (a_BlockType == E_BLOCK_REDSTONE_LAMP_ON);
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating lamp (%i %i %i)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating lamp (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
@ -37,7 +37,7 @@ namespace RedstoneLampHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Meta); UNUSED(a_Meta);

View File

@ -9,14 +9,14 @@
namespace RedstoneRepeaterHandler namespace RedstoneRepeaterHandler
{ {
inline bool IsOn(BLOCKTYPE a_Block) static bool IsOn(BLOCKTYPE a_Block)
{ {
return (a_Block == E_BLOCK_REDSTONE_REPEATER_ON); return (a_Block == E_BLOCK_REDSTONE_REPEATER_ON);
} }
/** Returns a pair with first element indicating if the block at the given position is an activated repeater. /** Returns a pair with first element indicating if the block at the given position is an activated repeater.
If it is activated, the second element is the repeater metadata. */ If it is activated, the second element is the repeater metadata. */
inline std::pair<bool, NIBBLETYPE> IsOnRepeater(cChunk & Chunk, const Vector3i a_Position) static std::pair<bool, NIBBLETYPE> IsOnRepeater(cChunk & Chunk, const Vector3i a_Position)
{ {
BLOCKTYPE Type; BLOCKTYPE Type;
NIBBLETYPE Meta; NIBBLETYPE Meta;
@ -32,7 +32,7 @@ namespace RedstoneRepeaterHandler
/** Determine, from the metadata of a repeater on our left side, if they lock us. /** Determine, from the metadata of a repeater on our left side, if they lock us.
To test a repeater on our right, simply invert the order of arguments provided. To test a repeater on our right, simply invert the order of arguments provided.
"Left" is relative to the direction the repeater output faces, naturally. */ "Left" is relative to the direction the repeater output faces, naturally. */
inline bool DoesLhsLockMe(NIBBLETYPE a_MetaLhs, NIBBLETYPE a_MyMeta) static bool DoesLhsLockMe(NIBBLETYPE a_MetaLhs, NIBBLETYPE a_MyMeta)
{ {
// Get the direction bits // Get the direction bits
a_MetaLhs &= E_META_REDSTONE_REPEATER_FACING_MASK; a_MetaLhs &= E_META_REDSTONE_REPEATER_FACING_MASK;
@ -64,7 +64,7 @@ namespace RedstoneRepeaterHandler
/** Determine if a repeater is locked. /** Determine if a repeater is locked.
A locked repeater is one with another powered repeater facing them, to their immediate left or right sides. A locked repeater is one with another powered repeater facing them, to their immediate left or right sides.
"Left" is relative to the direction the repeater output faces, naturally. */ "Left" is relative to the direction the repeater output faces, naturally. */
inline bool IsLocked(cChunk & Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) static bool IsLocked(cChunk & Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta)
{ {
// The left hand side offset. Will be negated to get the rhs offset // The left hand side offset. Will be negated to get the rhs offset
const auto LhsOffset = cBlockRedstoneRepeaterHandler::GetLeftCoordinateOffset(a_Meta); const auto LhsOffset = cBlockRedstoneRepeaterHandler::GetLeftCoordinateOffset(a_Meta);
@ -81,7 +81,7 @@ namespace RedstoneRepeaterHandler
return Rhs.first && DoesLhsLockMe(a_Meta, Rhs.second); return Rhs.first && DoesLhsLockMe(a_Meta, Rhs.second);
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
if (!IsOn(a_BlockType)) if (!IsOn(a_BlockType))
{ {
@ -98,7 +98,7 @@ namespace RedstoneRepeaterHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating loopy the repeater (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating loopy the repeater (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -148,7 +148,7 @@ namespace RedstoneRepeaterHandler
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockRedstoneRepeaterHandler::GetFrontCoordinateOffset(a_Meta)); UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockRedstoneRepeaterHandler::GetFrontCoordinateOffset(a_Meta));
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
Callback(cBlockRedstoneRepeaterHandler::GetRearCoordinateOffset(a_Meta) + a_Position); Callback(cBlockRedstoneRepeaterHandler::GetRearCoordinateOffset(a_Meta) + a_Position);
} }

View File

@ -10,7 +10,7 @@
namespace RedstoneToggleHandler namespace RedstoneToggleHandler
{ {
inline Vector3i GetOffsetAttachedTo(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) static Vector3i GetOffsetAttachedTo(Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
{ {
switch (a_BlockType) switch (a_BlockType)
{ {
@ -59,7 +59,7 @@ namespace RedstoneToggleHandler
} }
} }
inline unsigned char GetPowerLevel(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) static unsigned char GetPowerLevel(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta)
{ {
switch (a_BlockType) switch (a_BlockType)
{ {
@ -74,7 +74,7 @@ namespace RedstoneToggleHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_QueryBlockType); UNUSED(a_QueryBlockType);
@ -89,12 +89,12 @@ namespace RedstoneToggleHandler
return GetPowerLevel(a_BlockType, Meta); return GetPowerLevel(a_BlockType, Meta);
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating templatio<> the lever/button (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating templatio<> the lever/button (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -7,12 +7,12 @@
namespace RedstoneTorchHandler namespace RedstoneTorchHandler
{ {
inline bool IsOn(BLOCKTYPE a_Block) static bool IsOn(BLOCKTYPE a_Block)
{ {
return (a_Block == E_BLOCK_REDSTONE_TORCH_ON); return (a_Block == E_BLOCK_REDSTONE_TORCH_ON);
} }
inline Vector3i GetOffsetAttachedTo(const NIBBLETYPE a_Meta) static Vector3i GetOffsetAttachedTo(const NIBBLETYPE a_Meta)
{ {
switch (a_Meta) switch (a_Meta)
{ {
@ -29,7 +29,7 @@ namespace RedstoneTorchHandler
} }
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
const auto QueryOffset = a_QueryPosition - a_Position; const auto QueryOffset = a_QueryPosition - a_Position;
@ -45,7 +45,7 @@ namespace RedstoneTorchHandler
return 15; return 15;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating torchy the redstone torch (%i %i %i)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating torchy the redstone torch (%i %i %i)", a_Position.x, a_Position.y, a_Position.z);
@ -86,7 +86,7 @@ namespace RedstoneTorchHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -20,7 +20,7 @@ namespace RedstoneWireHandler
/** Invokes Callback with the wire's left, front, and right direction state corresponding to Offset. /** Invokes Callback with the wire's left, front, and right direction state corresponding to Offset.
Returns a new block constructed from the directions that the callback may have modified. */ Returns a new block constructed from the directions that the callback may have modified. */
template <class OffsetCallback> template <class OffsetCallback>
inline BlockState DoWithDirectionState(const Vector3i Offset, BlockState Block, OffsetCallback Callback) static BlockState DoWithDirectionState(const Vector3i Offset, BlockState Block, OffsetCallback Callback)
{ {
auto North = Block::RedstoneWire::North(Block); auto North = Block::RedstoneWire::North(Block);
auto South = Block::RedstoneWire::South(Block); auto South = Block::RedstoneWire::South(Block);
@ -49,7 +49,7 @@ namespace RedstoneWireHandler
} }
/** Adjusts a given wire block so that the direction represented by Offset has state Direction. */ /** Adjusts a given wire block so that the direction represented by Offset has state Direction. */
inline void SetDirectionState(const Vector3i Offset, BlockState & Block, TemporaryDirection Direction) static void SetDirectionState(const Vector3i Offset, BlockState & Block, TemporaryDirection Direction)
{ {
Block = DoWithDirectionState(Offset, Block, [Direction](auto, auto & Front, auto) Block = DoWithDirectionState(Offset, Block, [Direction](auto, auto & Front, auto)
{ {
@ -70,7 +70,7 @@ namespace RedstoneWireHandler
}); });
} }
inline bool IsDirectlyConnectingMechanism(BLOCKTYPE a_Block, NIBBLETYPE a_BlockMeta, const Vector3i a_Offset) static bool IsDirectlyConnectingMechanism(BLOCKTYPE a_Block, NIBBLETYPE a_BlockMeta, const Vector3i a_Offset)
{ {
switch (a_Block) switch (a_Block)
{ {
@ -102,7 +102,7 @@ namespace RedstoneWireHandler
/** Temporary. Discovers a wire's connection state, including terracing, storing the block inside redstone chunk data. /** Temporary. Discovers a wire's connection state, including terracing, storing the block inside redstone chunk data.
TODO: once the server supports block states this should go in the block handler, with data saved in the world. */ TODO: once the server supports block states this should go in the block handler, with data saved in the world. */
inline void SetWireState(const cChunk & Chunk, const Vector3i Position) static void SetWireState(const cChunk & Chunk, const Vector3i Position)
{ {
auto Block = Block::RedstoneWire::RedstoneWire(); auto Block = Block::RedstoneWire::RedstoneWire();
const auto YPTerraceBlock = Chunk.GetBlock(Position + OffsetYP); const auto YPTerraceBlock = Chunk.GetBlock(Position + OffsetYP);
@ -192,7 +192,7 @@ namespace RedstoneWireHandler
DataForChunk(Chunk).WireStates.emplace(Position, Block); DataForChunk(Chunk).WireStates.emplace(Position, Block);
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
// Starts off as the wire's meta value, modified appropriately and returned // Starts off as the wire's meta value, modified appropriately and returned
auto Power = a_Chunk.GetMeta(a_Position); auto Power = a_Chunk.GetMeta(a_Position);
@ -256,7 +256,7 @@ namespace RedstoneWireHandler
return Power; return Power;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating dusty the wire (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power); // LOGD("Evaluating dusty the wire (%d %d %d) %i", a_Position.x, a_Position.y, a_Position.z, Power);
@ -279,7 +279,7 @@ namespace RedstoneWireHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_BlockType); UNUSED(a_BlockType);
UNUSED(a_Meta); UNUSED(a_Meta);

View File

@ -7,7 +7,7 @@
namespace SmallGateHandler namespace SmallGateHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -18,7 +18,7 @@ namespace SmallGateHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating gateydory the fence gate/trapdoor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating gateydory the fence gate/trapdoor (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -33,7 +33,7 @@ namespace SmallGateHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -7,7 +7,7 @@
namespace TNTHandler namespace TNTHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);
@ -18,7 +18,7 @@ namespace TNTHandler
return 0; return 0;
} }
inline void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk &, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating explodinator the trinitrotoluene (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating explodinator the trinitrotoluene (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
if (Power != 0) if (Power != 0)
@ -28,7 +28,7 @@ namespace TNTHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);

View File

@ -9,7 +9,7 @@
namespace TrappedChestHandler namespace TrappedChestHandler
{ {
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_BlockType); UNUSED(a_BlockType);
UNUSED(a_QueryPosition); UNUSED(a_QueryPosition);
@ -19,7 +19,7 @@ namespace TrappedChestHandler
return DataForChunk(a_Chunk).GetCachedPowerData(a_Position); return DataForChunk(a_Chunk).GetCachedPowerData(a_Position);
} }
inline unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i a_Position) static unsigned char GetPowerLevel(cChunk & a_Chunk, Vector3i a_Position)
{ {
int NumberOfPlayers = 0; int NumberOfPlayers = 0;
VERIFY( VERIFY(
@ -34,7 +34,7 @@ namespace TrappedChestHandler
return static_cast<unsigned char>(std::min(NumberOfPlayers, 15)); return static_cast<unsigned char>(std::min(NumberOfPlayers, 15));
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating tricky the trapped chest (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating tricky the trapped chest (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -47,7 +47,7 @@ namespace TrappedChestHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_Position); UNUSED(a_Position);

View File

@ -9,7 +9,7 @@
namespace TripwireHookHandler namespace TripwireHookHandler
{ {
inline unsigned char GetPowerLevel(const cChunk & a_Chunk, Vector3i a_Position, NIBBLETYPE a_Meta) static unsigned char GetPowerLevel(const cChunk & a_Chunk, Vector3i a_Position, NIBBLETYPE a_Meta)
{ {
bool FoundActivated = false; bool FoundActivated = false;
const auto FaceToGoTowards = cBlockTripwireHookHandler::MetadataToDirection(a_Meta); const auto FaceToGoTowards = cBlockTripwireHookHandler::MetadataToDirection(a_Meta);
@ -60,7 +60,7 @@ namespace TripwireHookHandler
return 0; return 0;
} }
inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked) static PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{ {
UNUSED(a_BlockType); UNUSED(a_BlockType);
UNUSED(a_QueryBlockType); UNUSED(a_QueryBlockType);
@ -69,7 +69,7 @@ namespace TripwireHookHandler
return (GetPowerLevel(a_Chunk, a_Position, a_Chunk.GetMeta(a_Position)) == 15) ? 15 : 0; return (GetPowerLevel(a_Chunk, a_Position, a_Chunk.GetMeta(a_Position)) == 15) ? 15 : 0;
} }
inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power) static void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{ {
// LOGD("Evaluating hooky the tripwire hook (%d %d %d)", a_Position.x, a_Position.y, a_Position.z); // LOGD("Evaluating hooky the tripwire hook (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@ -101,7 +101,7 @@ namespace TripwireHookHandler
} }
} }
inline void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback) static void ForValidSourcePositions(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, ForEachSourceCallback & Callback)
{ {
UNUSED(a_Chunk); UNUSED(a_Chunk);
UNUSED(a_BlockType); UNUSED(a_BlockType);