redstone

package
v0.10.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	// contains filtered or unexported fields
}

State holds transient redstone runtime state owned by a world.

func (*State) BurnOutTorch

func (s *State) BurnOutTorch(pos cube.Pos)

BurnOutTorch marks a redstone torch as burned out until a later redstone update recovers it.

func (*State) ClearTorchBurnout

func (s *State) ClearTorchBurnout(pos cube.Pos)

ClearTorchBurnout removes transient burnout state for a redstone torch.

func (*State) MarkTorchSelfTriggeredIfActive

func (s *State) MarkTorchSelfTriggeredIfActive(pos cube.Pos)

MarkTorchSelfTriggeredIfActive marks the next scheduled tick for the redstone torch at pos as self-triggered if the current redstone propagation originated from that torch.

func (*State) PruneTorchBurnout

func (s *State) PruneTorchBurnout(pos cube.Pos, currentTick int64)

PruneTorchBurnout removes idle redstone torch burnout state once all tracked state changes have expired.

func (*State) RecordTorchToggle

func (s *State) RecordTorchToggle(pos cube.Pos, currentTick int64) (burnsOut bool)

RecordTorchToggle records a self-triggered redstone torch toggle and reports whether it should burn out.

func (*State) TorchBurnoutStatus

func (s *State) TorchBurnoutStatus(pos cube.Pos, currentTick int64) (burnedOut, recoverable bool)

TorchBurnoutStatus returns the current transient burnout state for a redstone torch. Expired state-change history is pruned before the state is returned.

func (*State) UpdateSource

func (s *State) UpdateSource() (cube.Pos, bool)

UpdateSource returns the position that caused the current redstone update.

func (*State) WithActiveTorchUpdate

func (s *State) WithActiveTorchUpdate(pos cube.Pos, fn func())

WithActiveTorchUpdate marks redstone propagation as originating from the redstone torch at pos for the duration of fn.

func (*State) WithUpdateSource

func (s *State) WithUpdateSource(pos cube.Pos, fn func())

WithUpdateSource marks redstone propagation as originating from pos for the duration of fn.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL