Interface RedstoneRegistry
public interface RedstoneRegistry
Which block types take part in redstone, and how: the
RedstoneBehaviour attached to each
of them.- Since:
- 0.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidattach(TypedKey<BlockType> block, RedstoneBehaviour behaviour, Plugin owner) Attaches a behaviour to a block type, in place of the one in effect.Returns the behaviour in effect for a block type, empty for a block taking no part in redstone.default Optional<RedstoneBehaviour> Returns the behaviour in effect for the type of a state, empty for a block taking no part in redstone.blocks()Returns an immutable snapshot of the block types that have a behaviour.booleanDetaches the behaviours an owner attached to a block type.voidDetaches every behaviour an owner attached, whatever the block type.
-
Method Details
-
attach
Attaches a behaviour to a block type, in place of the one in effect.- Parameters:
block- the block typebehaviour- its redstone behaviourowner- the owner of the attachment, usually thePlugininstance; it is released bydetachAll(Plugin)- Since:
- 0.1.0
-
detach
-
detachAll
Detaches every behaviour an owner attached, whatever the block type.- Parameters:
owner- the owner given when attaching- Since:
- 0.1.0
-
behaviour
Returns the behaviour in effect for a block type, empty for a block taking no part in redstone.- Parameters:
block- the block type- Returns:
- the behaviour in effect for a block type, empty for a block taking no part in redstone
- Since:
- 0.1.0
-
behaviour
Returns the behaviour in effect for the type of a state, empty for a block taking no part in redstone.- Parameters:
data- the state- Returns:
- the behaviour in effect for the type of a state, empty for a block taking no part in redstone
- Since:
- 0.1.0
-
blocks
-