Class ArmorMap<V extends Registered>

java.lang.Object
dev.jaxydog.astral.register.RegisteredMap<net.minecraft.item.ArmorItem.Type,V>
dev.jaxydog.astral.register.ArmorMap<V>
Type Parameters:
V - The type of the value stored within this map.
All Implemented Interfaces:
Registered, Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server

public class ArmorMap<V extends Registered> extends RegisteredMap<net.minecraft.item.ArmorItem.Type,V>
A map containing values assigned to armor types.
Since:
1.3.0
  • Constructor Details

    • ArmorMap

      public ArmorMap(@NotNull @NotNull String basePath, BiFunction<@NotNull String,@NotNull net.minecraft.item.ArmorItem.Type,V> computeCallback)
      Creates a new registered map.
      Parameters:
      basePath - The base identifier path.
      computeCallback - The value computation callback.
      Since:
      1.3.0
  • Method Details

    • keys

      public Set<@NotNull net.minecraft.item.ArmorItem.Type> keys()
      Description copied from class: RegisteredMap
      Returns the set of all expected keys.

      The values within this set are fed into the computation callback to generate the values stored within this map.

      Specified by:
      keys in class RegisteredMap<net.minecraft.item.ArmorItem.Type,V extends Registered>
      Returns:
      A set containing all expected keys.
    • compareKeys

      protected int compareKeys(@NotNull @NotNull net.minecraft.item.ArmorItem.Type left, @NotNull @NotNull net.minecraft.item.ArmorItem.Type right)
      Description copied from class: RegisteredMap
      Compares the provided keys to determine their registration order.

      If left is lesser than right, a negative value should be returned. If left is greater than right, a positive value should be returned. Otherwise, if both are equal, 0 should be returned.

      For a simple example, assuming <K> is of type Integer, the value can be determined by evaluating right - left for a simple natural ordering.

      Specified by:
      compareKeys in class RegisteredMap<net.minecraft.item.ArmorItem.Type,V extends Registered>
      Parameters:
      left - The left key.
      right - The right key.
      Returns:
      The result as defined in the method documentation.
    • getPath

      protected String getPath(@NotNull @NotNull net.minecraft.item.ArmorItem.Type key)
      Description copied from class: RegisteredMap
      Returns an identifier path based off of the given key.
      Specified by:
      getPath in class RegisteredMap<net.minecraft.item.ArmorItem.Type,V extends Registered>
      Parameters:
      key - The value's key.
      Returns:
      A valid identifier path.