Class PlatformRegistryImpl<T>
java.lang.Object
com.refinedmods.refinedstorage.common.support.registry.PlatformRegistryImpl<T>
- All Implemented Interfaces:
PlatformRegistry<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()get(net.minecraft.resources.ResourceLocation id) getAll()Optional<net.minecraft.resources.ResourceLocation> nextOrNullIfLast(T value) Returns the next value in the ordered list.voidRegisters a value in the registry, identified by the id.net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T>
-
Constructor Details
-
PlatformRegistryImpl
public PlatformRegistryImpl()
-
-
Method Details
-
register
Description copied from interface:PlatformRegistryRegisters a value in the registry, identified by the id. Duplicate IDs or values are not allowed.- Specified by:
registerin interfacePlatformRegistry<T>- Parameters:
id- the idvalue- the value
-
getId
- Specified by:
getIdin interfacePlatformRegistry<T>- Parameters:
value- the value- Returns:
- the id of the value, if present
-
get
- Specified by:
getin interfacePlatformRegistry<T>- Parameters:
id- the id- Returns:
- the value, if present
-
getAll
- Specified by:
getAllin interfacePlatformRegistry<T>- Returns:
- an unmodifiable list of all values
-
nextOrNullIfLast
Description copied from interface:PlatformRegistryReturns the next value in the ordered list. If the value is not found, it will return the first value. If the value is the last value in the ordered list, it will return null.- Specified by:
nextOrNullIfLastin interfacePlatformRegistry<T>- Parameters:
value- the given value- Returns:
- the next value after the given value, or null if it's the last value
-
codec
- Specified by:
codecin interfacePlatformRegistry<T>- Returns:
- a
Codecfor this registry
-
streamCodec
public net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,T> streamCodec()- Specified by:
streamCodecin interfacePlatformRegistry<T>- Returns:
- a
StreamCodecfor this registry
-