Cuberite
A lightweight, fast and extensible game server for Minecraft
Functions
RedstoneHandler Namespace Reference

Functions

void ForValidSourcePositions (const cChunk &Chunk, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta, ForEachSourceCallback &Callback)
 Invokes Callback for each position this component can accept power from. More...
 
PowerLevel GetPowerDeliveredToPosition (const cChunk &Chunk, Vector3i Position, BLOCKTYPE BlockType, Vector3i QueryPosition, BLOCKTYPE QueryBlockType, bool IsLinked)
 Asks a redstone component at the source position how much power it will deliver to the querying position. More...
 
void SetWireState (const cChunk &Chunk, Vector3i Position)
 Temporary: compute and set the block state of a redstone wire. More...
 
void Update (cChunk &Chunk, cChunk &CurrentlyTicking, Vector3i Position, BLOCKTYPE BlockType, NIBBLETYPE Meta, PowerLevel PowerLevel)
 Tells a redstone component at this position to update itself. More...
 

Function Documentation

◆ ForValidSourcePositions()

void RedstoneHandler::ForValidSourcePositions ( const cChunk Chunk,
const Vector3i  Position,
const BLOCKTYPE  BlockType,
const NIBBLETYPE  Meta,
ForEachSourceCallback Callback 
)

Invokes Callback for each position this component can accept power from.

Definition at line 114 of file RedstoneHandler.cpp.

◆ GetPowerDeliveredToPosition()

PowerLevel RedstoneHandler::GetPowerDeliveredToPosition ( const cChunk Chunk,
Vector3i  Position,
BLOCKTYPE  BlockType,
Vector3i  QueryPosition,
BLOCKTYPE  QueryBlockType,
bool  IsLinked 
)

Asks a redstone component at the source position how much power it will deliver to the querying position.

If IsLinked is true, QueryPosition should point to the intermediate conduit block. The Position and QueryPosition are both relative to Chunk.

Definition at line 97 of file RedstoneHandler.cpp.

◆ SetWireState()

void RedstoneHandler::SetWireState ( const cChunk Chunk,
const Vector3i  Position 
)

Temporary: compute and set the block state of a redstone wire.

Definition at line 119 of file RedstoneHandler.cpp.

◆ Update()

void RedstoneHandler::Update ( cChunk Chunk,
cChunk CurrentlyTicking,
Vector3i  Position,
BLOCKTYPE  BlockType,
NIBBLETYPE  Meta,
PowerLevel  PowerLevel 
)

Tells a redstone component at this position to update itself.

PowerLevel represents the maximum power level all of its source positions gave to it. Position is relative to Chunk, but if the component needs to queue neighbour updates, they are queued to CurrentlyTicking.

Definition at line 109 of file RedstoneHandler.cpp.