Class BuiltInJavaRegistries

java.lang.Object
org.geysermc.geyser.registry.java.BuiltInJavaRegistries

public final class BuiltInJavaRegistries extends Object
Defines Geyser-wide JavaRegistrys holding built-in Java content, for example, blocks and items. This content is static and will be the same across all sessions. These registries are initialised and populated early within Geyser's start-up process (see Registries.load(), which calls bootstrap()).

Should you need access to these registries, you can access a registry directly using its static field. Note that whilst these registries are exposed as MutableJavaRegistrys, they can only be registered to early in the start-up process. They will be frozen after freeze() is called. You should never call MutableJavaRegistry.clear() on any of these registries.

MutableJavaRegistry extends JavaRegistry and JavaRegistryLookup, which will provide plenty of utility methods to access registry content in all sorts of ways. They also implement Iterable, allowing easy for-loops over them.

In some cases you might need a JavaRegistryProvider, in which case you can use PROVIDER. Note however that this provider will not support tags or networked registries, so you should prefer to use GeyserSession.javaRegistries() when possible.

Built-in registries are registered at a root registry. To register new built-in registries, simply create a new static field and call register(JavaRegistryKey). Please maintain the same order as in JavaRegistries. Make sure to not forget to add a call to a bootstrap method in bootstrap(), so that the registry will be populated at the right time.

See Also: