Cuberite
A lightweight, fast and extensible game server for Minecraft
Enumerations | Functions
RedstoneWireHandler Namespace Reference

Enumerations

enum class  TemporaryDirection { Up , Side }
 A unified representation of wire direction. More...
 

Functions

template<class OffsetCallback >
static BlockState DoWithDirectionState (const Vector3i Offset, BlockState Block, OffsetCallback Callback)
 Invokes Callback with the wire's left, front, and right direction state corresponding to Offset. More...
 
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 bool IsDirectlyConnectingMechanism (BLOCKTYPE a_Block, NIBBLETYPE a_BlockMeta, const Vector3i a_Offset)
 
static bool IsYPTerracingBlocked (const cChunk &a_Chunk, const Vector3i a_Position)
 
static void SetDirectionState (const Vector3i Offset, BlockState &Block, TemporaryDirection Direction)
 Adjusts a given wire block so that the direction represented by Offset has state Direction. More...
 
static void SetWireState (const cChunk &a_Chunk, const Vector3i a_Position)
 Temporary. More...
 
static void Update (cChunk &a_Chunk, cChunk &CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
 

Enumeration Type Documentation

◆ TemporaryDirection

A unified representation of wire direction.

Enumerator
Up 
Side 

Definition at line 14 of file RedstoneWireHandler.h.

Function Documentation

◆ DoWithDirectionState()

template<class OffsetCallback >
static BlockState RedstoneWireHandler::DoWithDirectionState ( const Vector3i  Offset,
BlockState  Block,
OffsetCallback  Callback 
)
static

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.

Definition at line 23 of file RedstoneWireHandler.h.

◆ ForValidSourcePositions()

static void RedstoneWireHandler::ForValidSourcePositions ( const cChunk a_Chunk,
Vector3i  a_Position,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_Meta,
ForEachSourceCallback Callback 
)
static

Definition at line 289 of file RedstoneWireHandler.h.

◆ GetPowerDeliveredToPosition()

static PowerLevel RedstoneWireHandler::GetPowerDeliveredToPosition ( const cChunk a_Chunk,
Vector3i  a_Position,
BLOCKTYPE  a_BlockType,
Vector3i  a_QueryPosition,
BLOCKTYPE  a_QueryBlockType,
bool  IsLinked 
)
static

Definition at line 209 of file RedstoneWireHandler.h.

◆ IsDirectlyConnectingMechanism()

static bool RedstoneWireHandler::IsDirectlyConnectingMechanism ( BLOCKTYPE  a_Block,
NIBBLETYPE  a_BlockMeta,
const Vector3i  a_Offset 
)
static

Definition at line 73 of file RedstoneWireHandler.h.

◆ IsYPTerracingBlocked()

static bool RedstoneWireHandler::IsYPTerracingBlocked ( const cChunk a_Chunk,
const Vector3i  a_Position 
)
static

Definition at line 103 of file RedstoneWireHandler.h.

◆ SetDirectionState()

static void RedstoneWireHandler::SetDirectionState ( const Vector3i  Offset,
BlockState Block,
TemporaryDirection  Direction 
)
static

Adjusts a given wire block so that the direction represented by Offset has state Direction.

Definition at line 52 of file RedstoneWireHandler.h.

◆ SetWireState()

static void RedstoneWireHandler::SetWireState ( const cChunk a_Chunk,
const Vector3i  a_Position 
)
static

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.

Definition at line 119 of file RedstoneWireHandler.h.

◆ Update()

static void RedstoneWireHandler::Update ( cChunk a_Chunk,
cChunk CurrentlyTicking,
Vector3i  a_Position,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_Meta,
const PowerLevel  Power 
)
static

Definition at line 273 of file RedstoneWireHandler.h.