Class ResourceCategory

java.lang.Object
fr.robie.machineengine.api.resource.ResourceCategory
All Implemented Interfaces:
net.kyori.adventure.key.Keyed

public final class ResourceCategory extends Object implements net.kyori.adventure.key.Keyed
A family of resources, e.g. energyplugin:energy or mymod:fluid (ARCHITECTURE.md ยง9.1). MachineEngine attaches no meaning to categories.

Amounts are longs in base units (D10). scale() is the number of decimal digits used when displaying them: a scale of 3 shows 1500 base units as 1.500.

Definitions are canonical: compare them by reference.

  • Method Details

    • builder

      @NotNull public static @NotNull ResourceCategory.Builder builder(@NotNull @NotNull net.kyori.adventure.key.Key key)
    • key

      @NotNull public @NotNull net.kyori.adventure.key.Key key()
      Specified by:
      key in interface net.kyori.adventure.key.Keyed
    • unit

      @NotNull public @NotNull String unit()
      Name of the base unit, e.g. mB or FE. Display only.
    • scale

      public int scale()
      Decimal digits used to display amounts.
    • mergePolicy

      @NotNull public @NotNull MergePolicy mergePolicy()
      How two stacks of one type with different components combine in a storage.
    • toString

      public String toString()
      Overrides:
      toString in class Object