35 lines
1.4 KiB
Java
35 lines
1.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.Codec
|
|
*/
|
|
package net.minecraft.core;
|
|
|
|
import com.mojang.serialization.Codec;
|
|
import net.minecraft.core.HolderSet;
|
|
import net.minecraft.core.Registry;
|
|
import net.minecraft.resources.HolderSetCodec;
|
|
import net.minecraft.resources.RegistryFileCodec;
|
|
import net.minecraft.resources.RegistryFixedCodec;
|
|
import net.minecraft.resources.ResourceKey;
|
|
|
|
public class RegistryCodecs {
|
|
public static <E> Codec<HolderSet<E>> homogeneousList(ResourceKey<? extends Registry<E>> registryKey, Codec<E> elementCodec) {
|
|
return RegistryCodecs.homogeneousList(registryKey, elementCodec, false);
|
|
}
|
|
|
|
public static <E> Codec<HolderSet<E>> homogeneousList(ResourceKey<? extends Registry<E>> registryKey, Codec<E> elementCodec, boolean alwaysUseList) {
|
|
return HolderSetCodec.create(registryKey, RegistryFileCodec.create(registryKey, elementCodec), alwaysUseList);
|
|
}
|
|
|
|
public static <E> Codec<HolderSet<E>> homogeneousList(ResourceKey<? extends Registry<E>> registryKey) {
|
|
return RegistryCodecs.homogeneousList(registryKey, false);
|
|
}
|
|
|
|
public static <E> Codec<HolderSet<E>> homogeneousList(ResourceKey<? extends Registry<E>> registryKey, boolean alwaysUseList) {
|
|
return HolderSetCodec.create(registryKey, RegistryFixedCodec.create(registryKey), alwaysUseList);
|
|
}
|
|
}
|
|
|