Class BuiltInResources

java.lang.Object
fr.robie.machineengine.api.resource.BuiltInResources

@Internal public final class BuiltInResources extends Object
The resources MachineEngine provides to every addon and definition: Energy and Fluids (D29). Their units, scales and bucket size come from config.yml, so they are built once, from the config, the first time they are needed; addons read them through the getters of Energy and Fluids.
  • Method Details

    • create

      @NotNull public static @NotNull BuiltInResources.Built create(@NotNull @NotNull ConfigValues config)
      Builds new resources from config without installing them (tests compare settings with it).
    • install

      @NotNull public static @NotNull BuiltInResources.Built install(@NotNull @NotNull ConfigValues config)
      Builds the resources from the loaded config.yml. MachineEngine calls it in onLoad, 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

      @NotNull public static @NotNull BuiltInResources.Built get()
      The built resources. Built from MachineEngine.config() on first use: on a server that is the loaded config.yml; without a server, the defaults.