Class ExtraCodecs
java.lang.Object
net.minecraft.util.ExtraCodecs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<GameProfile> static final Codec<org.joml.AxisAngle4f> static final Codec<byte[]> static final Function<OptionalLong, Optional<Long>> private static final Stringstatic final Codec<com.google.gson.JsonElement> static final Codec<org.joml.Matrix4fc> static final intstatic final intstatic final intstatic final intstatic final Codec<PropertyMap> static final Codec<org.joml.Quaternionfc> static final Codec<org.joml.Quaternionfc> static final MapCodec<GameProfile> static final Codec<ExtraCodecs.TagOrElementLocation> static final Function<Optional<Long>, OptionalLong> static final Codec<org.joml.Vector2fc> static final Codec<org.joml.Vector3fc> static final Codec<org.joml.Vector3ic> static final Codec<org.joml.Vector4fc> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MapCodec<OptionalLong> asOptionalLong(MapCodec<Optional<Long>> fieldCodec) static <A> Codec<A> catchDecoderException(Codec<A> codec) compactListCodec(Codec<E> elementCodec) compactListCodec(Codec<E> elementCodec, Codec<List<E>> listCodec) static <T> Codec<T> converter(DynamicOps<T> ops) static <K,V> MapCodec <V> dispatchOptionalValue(String typeKey, String valueKey, Codec<K> typeCodec, Function<? super V, ? extends K> typeGetter, Function<? super K, ? extends Codec<? extends V>> valueCodec) Deprecated.static <E, L extends Collection<E>, T>
Function<L, DataResult<L>> ensureHomogenous(Function<E, T> typeGetter) floatRange(float minInclusive, float maxInclusive) floatRangeMinExclusiveWithMessage(float minExclusive, float maxInclusive, Function<Float, String> error) floatRangeMinInclusiveWithMessage(float minInclusive, float maxInclusive, Function<Float, String> error) private static MapCodec<GameProfile> gameProfileCodec(Codec<UUID> uuidCodec) guardedPathCodec(Path baseFolder) hexColor(int expectedDigits) static <I,E> Codec <E> idResolverCodec(Codec<I> value, Function<I, @Nullable E> fromId, Function<E, @Nullable I> toId) static <E> Codec<E> idResolverCodec(ToIntFunction<E> toInt, IntFunction<@Nullable E> fromInt, int unknownId) static <P,I> Codec <I> intervalCodec(Codec<P> pointCodec, String lowerBoundName, String upperBoundName, BiFunction<P, P, DataResult<I>> makeInterval, Function<I, P> getMin, Function<I, P> getMax) intRange(int minInclusive, int maxInclusive) intRangeWithMessage(int minInclusive, int maxInclusive, Function<Integer, String> error) legacyEnum(Function<String, E> valueOf) Deprecated.longRange(int minInclusive, int maxInclusive) longRangeWithMessage(long minInclusive, long maxInclusive, Function<Long, String> error) nonEmptyHolderSet(Codec<HolderSet<T>> listCodec) nonEmptyList(Codec<List<T>> listCodec) nonEmptyMap(Codec<M> mapCodec) static <T> Codec<it.unimi.dsi.fastutil.objects.Object2BooleanMap<T>> object2BooleanMap(Codec<T> keyCodec) optionalEmptyMap(Codec<A> codec) static <E> Codec<E> orCompressed(Codec<E> normal, Codec<E> compressed) static <E> MapCodec<E> orCompressed(MapCodec<E> normal, MapCodec<E> compressed) static <A> Codec.ResultFunction<A> orElsePartial(A value) static <E> Codec<E> overrideLifecycle(Codec<E> codec, Function<E, Lifecycle> lifecycleGetter) static <E> Codec<E> overrideLifecycle(Codec<E> codec, Function<E, Lifecycle> decodeLifecycle, Function<E, Lifecycle> encodeLifecycle) relaiveNormalizedSubPathCodec(Function<String, Path> pathFactory) static <E> MapCodec<E> retrieveContext(Function<DynamicOps<?>, DataResult<E>> getter) sizeLimitedMap(Codec<Map<K, V>> codec, int maxSizeInclusive) static <K,V> ExtraCodecs.StrictUnboundedMapCodec <K, V> strictUnboundedMap(Codec<K> keyCodec, Codec<V> elementCodec) static Codec<TemporalAccessor> temporalCodec(DateTimeFormatter formatter)
-
Field Details
-
JSON
-
JAVA
-
NBT
-
VECTOR2F
-
VECTOR3F
-
VECTOR3I
-
VECTOR4F
-
QUATERNIONF_COMPONENTS
-
AXISANGLE4F
-
QUATERNIONF
-
MATRIX4F
-
HEX_COLOR_PREFIX
- See Also:
-
RGB_COLOR_CODEC
-
ARGB_COLOR_CODEC
-
STRING_RGB_COLOR
-
STRING_ARGB_COLOR
-
UNSIGNED_BYTE
-
NON_NEGATIVE_INT
-
POSITIVE_INT
-
NON_NEGATIVE_LONG
-
POSITIVE_LONG
-
NON_NEGATIVE_FLOAT
-
POSITIVE_FLOAT
-
PATTERN
-
INSTANT_ISO8601
-
BASE64_STRING
-
ESCAPED_STRING
-
TAG_OR_ELEMENT_ID
-
toOptionalLong
-
fromOptionalLong
-
BIT_SET
-
MAX_PROPERTY_NAME_LENGTH
public static final int MAX_PROPERTY_NAME_LENGTH- See Also:
-
MAX_PROPERTY_VALUE_LENGTH
public static final int MAX_PROPERTY_VALUE_LENGTH- See Also:
-
MAX_PROPERTY_SIGNATURE_LENGTH
public static final int MAX_PROPERTY_SIGNATURE_LENGTH- See Also:
-
MAX_PROPERTIES
public static final int MAX_PROPERTIES- See Also:
-
PROPERTY
-
PROPERTY_MAP
-
PLAYER_NAME
-
AUTHLIB_GAME_PROFILE
-
STORED_GAME_PROFILE
-
NON_EMPTY_STRING
-
CODEPOINT
-
RESOURCE_PATH_CODEC
-
UNTRUSTED_URI
-
CHAT_STRING
-
-
Constructor Details
-
ExtraCodecs
public ExtraCodecs()
-
-
Method Details
-
converter
-
hexColor
-
intervalCodec
public static <P,I> Codec<I> intervalCodec(Codec<P> pointCodec, String lowerBoundName, String upperBoundName, BiFunction<P, P, DataResult<I>> makeInterval, Function<I, P> getMin, Function<I, P> getMax) -
orElsePartial
-
idResolverCodec
public static <E> Codec<E> idResolverCodec(ToIntFunction<E> toInt, IntFunction<@Nullable E> fromInt, int unknownId) -
idResolverCodec
-
orCompressed
-
orCompressed
-
overrideLifecycle
-
overrideLifecycle
-
strictUnboundedMap
public static <K,V> ExtraCodecs.StrictUnboundedMapCodec<K,V> strictUnboundedMap(Codec<K> keyCodec, Codec<V> elementCodec) -
compactListCodec
-
compactListCodec
-
intRangeWithMessage
-
intRange
-
longRangeWithMessage
-
longRange
-
floatRangeMinInclusiveWithMessage
-
floatRangeMinExclusiveWithMessage
-
floatRange
-
nonEmptyList
-
nonEmptyHolderSet
-
nonEmptyMap
-
retrieveContext
-
ensureHomogenous
public static <E, L extends Collection<E>, T> Function<L, DataResult<L>> ensureHomogenous(Function<E, T> typeGetter) -
catchDecoderException
-
temporalCodec
-
asOptionalLong
-
gameProfileCodec
-
sizeLimitedMap
-
object2BooleanMap
-
dispatchOptionalValue
-
optionalEmptyMap
-
legacyEnum
Deprecated. -
pathCodec
-
relaiveNormalizedSubPathCodec
-
guardedPathCodec
-