Interface PlatformRegistry<T>
- Type Parameters:
T- the value type
- All Known Implementing Classes:
PlatformRegistryImpl
@API(status=STABLE,
since="2.0.0-milestone.2.0")
public interface PlatformRegistry<T>
-
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.Codec<T> codec()get(net.minecraft.resources.Identifier id) getAll()Optional<net.minecraft.resources.Identifier> @Nullable TnextOrNullIfLast(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>
-
Method Details
-
register
Registers a value in the registry, identified by the id. Duplicate IDs or values are not allowed.- Parameters:
id- the idvalue- the value
-
getId
-
get
-
getAll
-
nextOrNullIfLast
Returns 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.- Parameters:
value- the given value- Returns:
- the next value after the given value, or null if it's the last value
-
codec
com.mojang.serialization.Codec<T> codec()- Returns:
- a
Codecfor this registry
-
streamCodec
net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, T> streamCodec()- Returns:
- a
StreamCodecfor this registry
-