Class BuiltInResources
java.lang.Object
fr.robie.machineengine.api.resource.BuiltInResources
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe resources, units, scales and bucket size built fromconfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull BuiltInResources.Builtcreate(@NotNull ConfigValues config) Builds new resources fromconfigwithout installing them (tests compare settings with it).static @NotNull BuiltInResources.Builtget()The built resources.static @NotNull BuiltInResources.Builtinstall(@NotNull ConfigValues config) Builds the resources from the loadedconfig.yml.
-
Method Details
-
create
@NotNull public static @NotNull BuiltInResources.Built create(@NotNull @NotNull ConfigValues config) Builds new resources fromconfigwithout installing them (tests compare settings with it). -
install
@NotNull public static @NotNull BuiltInResources.Built install(@NotNull @NotNull ConfigValues config) Builds the resources from the loadedconfig.yml. MachineEngine calls it inonLoad, right after loading the config and before any addon loads.- Throws:
IllegalStateException- if they were already built with other settings: registries cannot change while the server runs
-
get
The built resources. Built fromMachineEngine.config()on first use: on a server that is the loadedconfig.yml; without a server, the defaults.
-