Interface BlockRegistry
public interface BlockRegistry
Every block type the server knows, vanilla and plugin-defined.
- Since:
- 0.1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Optional<BlockBehaviour> Returns the behaviour driving the type of a state, if any.default Optional<BlockBehaviour> Returns the behaviour driving a block type, if any.fromNetworkId(int networkId) Returns the state with the given network identifier, ornullif it is unknown.Parses a state in command syntax, for instanceminecraft:oak_stairs[facing=north].default voidregister(BlockBehaviour behaviour) Registers the block type a behaviour drives.voidRegisters a block type.Returns the block type registered under a key, if any.Returns the block type registered under a key, if any.types()Returns every registered block type.
-
Method Details
-
type
-
type
Returns the block type registered under a key, if any.- Parameters:
key- the block key, for instanceminecraft:stone- Returns:
- the block type registered under a key, if any
- Since:
- 0.1.0
-
fromNetworkId
-
register
Registers a block type.- Parameters:
type- the block type- Since:
- 0.1.0
-
register
Registers the block type a behaviour drives.- Parameters:
behaviour- the behaviour- Since:
- 0.1.0
-
behaviour
Returns the behaviour driving a block type, if any.- Parameters:
key- the block key- Returns:
- the behaviour driving a block type, if any
- Since:
- 0.1.0
-
behaviour
Returns the behaviour driving the type of a state, if any.- Parameters:
data- the state- Returns:
- the behaviour driving the type of a state, if any
- Since:
- 0.1.0
-
types
Collection<BlockType> types()Returns every registered block type.- Returns:
- every registered block type
- Since:
- 0.1.0
-
parse
Parses a state in command syntax, for instanceminecraft:oak_stairs[facing=north].- Parameters:
input- the state to parse- Returns:
- the state, or
nullif the block is unknown - Throws:
IllegalArgumentException- if the syntax is malformed or a property is unknown- Since:
- 0.1.0
-