Class PlaceholderMimicItem.Group
java.lang.Object
dev.jaxydog.astral.register.RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
dev.jaxydog.astral.content.item.custom.PlaceholderMimicItem.Group
- All Implemented Interfaces:
Registered,Registered.All,Registered.Client,Registered.Common,Registered.Generated,Registered.Server
- Enclosing class:
PlaceholderMimicItem
public static class PlaceholderMimicItem.Group
extends RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
A group of mimicking placeholder items.
This is most useful for bulk declaration, for example when defining armor items or dye items.
- Since:
- 1.4.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
ConstructorsConstructorDescriptionGroup(String path, net.minecraft.item.Item.Settings settings, @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup, net.minecraft.item.Item... items) Creates a new group of mimicking items.Creates a new group of mimicking items. -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareKeys(@NotNull net.minecraft.item.Item a, @NotNull net.minecraft.item.Item b) Compares the provided keys to determine their registration order.protected StringgetPath(@NotNull net.minecraft.item.Item key) Returns an identifier path based off of the given key.Set<net.minecraft.item.Item> 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
-
Group
public Group(String path, net.minecraft.item.Item.Settings settings, @Nullable @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup, net.minecraft.item.Item... items) Creates a new group of mimicking items.If the
#preferredGroupsupplier isnull, the items will not be added to any item groups.- Parameters:
path- The item's base identifier path.settings- The item's settings.preferredGroup- The item's preferred item group.items- The items to be mimicked.- Since:
- 2.0.0
-
Group
public Group(String path, net.minecraft.item.Item.Settings settings, net.minecraft.item.Item... items) Creates a new group of mimicking items.The items will be added to the default item group.
- Parameters:
path- The item's base identifier path.settings- The item's settings.items- The items to be mimicked.- Since:
- 1.4.0
-
-
Method Details
-
compareKeys
protected int compareKeys(@NotNull @NotNull net.minecraft.item.Item a, @NotNull @NotNull net.minecraft.item.Item b) 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.Item,PlaceholderMimicItem> - Parameters:
a- The left key.b- 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.Item,PlaceholderMimicItem> - Parameters:
key- The value's key.- Returns:
- A valid identifier path.
-
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.Item,PlaceholderMimicItem> - Returns:
- A set containing all expected keys.
-