Class Blocks
java.lang.Object
fr.fidorial.world.block.Blocks
Static access to the
BlockRegistry, bootstrapped by the server at startup.- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbootstrap(BlockRegistry blockRegistry) Installs the registry.Parses a state in command syntax.static BlockRegistryregistry()Returns the installed registry.Returns the block type registered under a key, ornull.Returns the block type registered under a key, ornull.
-
Method Details
-
bootstrap
Installs the registry. Called once by the server.- Parameters:
blockRegistry- the registry- Throws:
IllegalStateException- if a registry is already installed- Since:
- 0.1.0
-
registry
Returns the installed registry.- Returns:
- the installed registry
- Throws:
IllegalStateException- if the server has not bootstrapped it yet- Since:
- 0.1.0
-
type
Returns the block type registered under a key, ornull.- Parameters:
key- the block key, for instanceminecraft:stone- Returns:
- the block type registered under a key, or
null - Since:
- 0.1.0
-
type
-
data
Parses a state in command syntax.- Parameters:
input- the state to parse, for instanceminecraft:oak_stairs[facing=north]- Returns:
- the state, or
nullif the block is unknown - Throws:
IllegalArgumentException- if the syntax is malformed- Since:
- 0.1.0
-