Class CustomRegistry<B extends io.netty.buffer.ByteBuf, V>
java.lang.Object
dev.latvian.mods.klib.registry.CustomRegistry<B,V>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCustomRegistry.Builder<B extends io.netty.buffer.ByteBuf, T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, CustomRegistry<?, ?>> static final Map<DataType<?>, CustomRegistry<?, ?>> final com.mojang.serialization.Codec<CustomRegistryType<B, V>> -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic <B extends io.netty.buffer.ByteBuf, T>
CustomRegistry.Builder<B, T> builder()com.mojang.serialization.Codec<V> codec()com.mojang.brigadier.arguments.ArgumentType<V> createArgument(net.minecraft.commands.CommandBuildContext ctx) dataType()@Nullable CustomRegistryType<B, V> decodeType(B buf) decodeValue(B buf) <D extends V>
CustomRegistryType.Dynamic<B, V> dynamic(net.minecraft.resources.Identifier id, com.mojang.serialization.MapCodec<D> codec, net.minecraft.network.codec.StreamCodec<? super B, D> streamCodec) voidencodeType(io.netty.buffer.ByteBuf buf, @Nullable CustomRegistryType<B, V> value) voidencodeValue(B buf, V value) @Nullable net.minecraft.resources.ResourceKey<V> @Nullable CustomRegistryType<B, V> getOptionalType(V value) intgetValueIndex(V value) voidreadMeta(@Nullable CustomRegistryMetaInfo<V> info) voidreadValues(CustomRegistryValueInfo<V> info, net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType) static voidregisterAll(Consumer<CustomRegistryCollector> callback) voidregisterTypes(Consumer<CustomRegistryTypeCollector<B, V>> callback) side()static voidsync(net.minecraft.server.level.ServerPlayer player) Map<net.minecraft.resources.ResourceKey<V>, CustomRegistryType<B, V>> typeMap()unitWithType(net.minecraft.resources.Identifier id, Function<CustomRegistryType<B, V>, V> instance) voidupdateValues(Map<net.minecraft.resources.Identifier, V> map) valueMap()writeValues(net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType)
-
Field Details
-
ALL
public static final Map<net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<?>>, CustomRegistry<?,?>> ALL -
DATA_TYPE_TO_REGISTRY
-
typeCodec
public final com.mojang.serialization.Codec<CustomRegistryType<B extends io.netty.buffer.ByteBuf, V>> typeCodec
-
-
Method Details
-
registerAll
-
buildAllMeta
public static void buildAllMeta() -
sync
public static void sync(net.minecraft.server.level.ServerPlayer player) -
builder
-
unitWithType
public CustomRegistryType.Unit<B,V> unitWithType(net.minecraft.resources.Identifier id, Function<CustomRegistryType<B, V>, V> instance) -
unit
-
dynamic
public <D extends V> CustomRegistryType.Dynamic<B,V> dynamic(net.minecraft.resources.Identifier id, com.mojang.serialization.MapCodec<D> codec, net.minecraft.network.codec.StreamCodec<? super B, D> streamCodec) -
registerTypes
-
writeMeta
-
readMeta
-
updateValues
-
writeValues
public CustomRegistryValueInfo<V> writeValues(net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType) -
readValues
public void readValues(CustomRegistryValueInfo<V> info, net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType) -
side
-
registryKeys
-
getOptionalType
-
getType
-
getKey
-
codec
-
streamCodec
-
dataType
-
typeMap
-
valueMap
-
sortedKeys
-
decodeValue
-
getValueIndex
-
encodeValue
-
decodeType
-
encodeType
public void encodeType(io.netty.buffer.ByteBuf buf, @Nullable @Nullable CustomRegistryType<B, V> value) -
createArgument
@Internal public com.mojang.brigadier.arguments.ArgumentType<V> createArgument(net.minecraft.commands.CommandBuildContext ctx)
-