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()codec()createArgument(net.minecraft.commands.CommandBuildContext ctx) dataType()@Nullable CustomRegistryType<B, V> decodeType(B buf) decodeValue(B buf) com.mojang.serialization.Codec<V> <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, @Nullable Ref<V> ref) get(net.minecraft.resources.Identifier id) @Nullable net.minecraft.resources.ResourceKey<V> @Nullable CustomRegistryType<B, V> getOptionalType(Ref<V> ref) @Nullable CustomRegistryType<B, V> getOptionalType(V value) @Nullable CustomRegistryType<B, V> intgetValueIndex(net.minecraft.resources.ResourceKey<V> key) iterator()voidreadMeta(@Nullable CustomRegistryMetaInfo<V> info) voidreadValues(CustomRegistryValueInfo<V> info, net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType) ref(net.minecraft.resources.Identifier id) static voidregisterAll(Consumer<CustomRegistryCollector> callback) voidregisterTypes(Consumer<CustomRegistryTypeCollector<B, V>> callback) static voidsync(net.minecraft.server.level.ServerPlayer player) booleantypeList()unitWithType(net.minecraft.resources.Identifier id, Function<CustomRegistryType<B, V>, V> instance) voidupdateValues(Map<net.minecraft.resources.Identifier, V> map) values()writeValues(net.minecraft.core.RegistryAccess registryAccess, PlatformType platformType) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
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) -
ref
-
ref
-
ref
-
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) -
syncValues
public boolean syncValues() -
registryKeys
-
getOptionalType
-
getOptionalType
-
getType
@Nullable public @Nullable CustomRegistryType<B,V> getType(net.minecraft.resources.ResourceKey<V> key) -
getType
-
getType
-
getKey
-
directCodec
-
codec
-
streamCodec
-
dataType
-
typeList
-
get
-
get
-
values
-
iterator
-
decodeValue
-
getValueIndex
-
encodeValue
-
decodeType
-
encodeType
public void encodeType(io.netty.buffer.ByteBuf buf, @Nullable @Nullable CustomRegistryType<B, V> value) -
createArgument
-