![JAR search and dependency download from the Maven repository](/logo.png)
dev.thomasglasser.sherdsapi.impl.Sherd Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sherdsapi-common-1.20.4 Show documentation
Show all versions of sherdsapi-common-1.20.4 Show documentation
Makes adding new pottery sherds easier
The newest version!
package dev.thomasglasser.sherdsapi.impl;
import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.item.crafting.Ingredient;
import org.jetbrains.annotations.ApiStatus;
import java.util.Optional;
@ApiStatus.Internal
public record Sherd(Ingredient ingredient, Optional> pattern)
{
public static final Codec CODEC = RecordCodecBuilder.create(instance -> instance.group(
Ingredient.CODEC_NONEMPTY.fieldOf("ingredient").forGetter(Sherd::ingredient),
ResourceKey.codec(Registries.DECORATED_POT_PATTERNS).optionalFieldOf("pattern").forGetter(Sherd::pattern)
).apply(instance, Sherd::new));
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy