Package dev.jaxydog.astral.register
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server -
Field Summary
Fields inherited from class dev.jaxydog.astral.register.RegisteredMap
innerMap -
Constructor Summary
ConstructorsConstructorDescriptionArmorMap(@NotNull String basePath, BiFunction<@NotNull String, @NotNull net.minecraft.item.ArmorItem.Type, V> computeCallback) Creates a new registered map. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareKeys(@NotNull net.minecraft.item.ArmorItem.Type left, @NotNull net.minecraft.item.ArmorItem.Type right) Compares the provided keys to determine their registration order.protected StringgetPath(@NotNull net.minecraft.item.ArmorItem.Type key) Returns an identifier path based off of the given key.Set<@NotNull net.minecraft.item.ArmorItem.Type> keys()Returns the set of all expected keys.Methods inherited from class dev.jaxydog.astral.register.RegisteredMap
computeValues, computeValuesIfMissing, entries, generate, get, getComputed, getNullable, getRegistryPath, registerClient, registerCommon, registerServer, sortedValuesOfType, valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId
-
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
Description copied from class:RegisteredMapReturns 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:
keysin classRegisteredMap<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:RegisteredMapCompares the provided keys to determine their registration order.If
leftis lesser thanright, a negative value should be returned. Ifleftis greater thanright, a positive value should be returned. Otherwise, if both are equal,0should be returned.For a simple example, assuming
<K>is of typeInteger, the value can be determined by evaluatingright - leftfor a simple natural ordering.- Specified by:
compareKeysin classRegisteredMap<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
Description copied from class:RegisteredMapReturns an identifier path based off of the given key.- Specified by:
getPathin classRegisteredMap<net.minecraft.item.ArmorItem.Type,V extends Registered> - Parameters:
key- The value's key.- Returns:
- A valid identifier path.
-