mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
@@ -8,7 +8,7 @@ buildscript {
|
||||
|
||||
plugins {
|
||||
id "architectury-plugin" version "3.4-SNAPSHOT"
|
||||
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
|
||||
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
|
||||
id "org.cadixdev.licenser" version "0.6.1"
|
||||
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
|
||||
id "maven-publish"
|
||||
|
||||
@@ -128,7 +128,7 @@ public enum FluidStackImpl implements FluidStack.FluidStackAdapter<FluidStackImp
|
||||
public Codec<FluidStack> codec() {
|
||||
return RecordCodecBuilder.create(instance -> instance.group(
|
||||
BuiltInRegistries.FLUID.holderByNameCodec().fieldOf("fluid").forGetter(stack -> stack.getFluid().builtInRegistryHolder()),
|
||||
ExtraCodecs.validate(Codec.LONG, value -> {
|
||||
Codec.LONG.validate(value -> {
|
||||
return value.compareTo(0L) >= 0 && value.compareTo(Long.MAX_VALUE) <= 0
|
||||
? DataResult.success(value)
|
||||
: DataResult.error(() -> "Value must be non-negative: " + value);
|
||||
|
||||
@@ -77,7 +77,7 @@ public class FluidStackHooksImpl {
|
||||
}
|
||||
|
||||
public static Tag write(HolderLookup.Provider provider, FluidStack stack, Tag tag) {
|
||||
return Util.getOrThrow(FluidStack.CODEC.encode(stack, provider.createSerializationContext(NbtOps.INSTANCE), tag), IllegalStateException::new);
|
||||
return FluidStack.CODEC.encode(stack, provider.createSerializationContext(NbtOps.INSTANCE), tag).getOrThrow(IllegalStateException::new);
|
||||
}
|
||||
|
||||
public static long bucketAmount() {
|
||||
|
||||
@@ -3,8 +3,8 @@ org.gradle.daemon=false
|
||||
|
||||
platforms=fabric
|
||||
|
||||
minecraft_version=24w12a
|
||||
supported_version=1.20.5 (24w12a)
|
||||
minecraft_version=24w14a
|
||||
supported_version=1.20.5 (24w14a)
|
||||
|
||||
artifact_type=beta
|
||||
|
||||
@@ -13,8 +13,8 @@ archives_base_name_snapshot=architectury-snapshot
|
||||
base_version=12.0
|
||||
maven_group=dev.architectury
|
||||
|
||||
fabric_loader_version=0.15.7
|
||||
fabric_api_version=0.96.12+1.20.5
|
||||
fabric_loader_version=0.15.9
|
||||
fabric_api_version=0.96.14+1.20.5
|
||||
mod_menu_version=9.0.0
|
||||
|
||||
forge_version=49.0.14
|
||||
|
||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
package dev.architectury.test.recipes;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import com.mojang.serialization.MapCodec;
|
||||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
import net.minecraft.network.FriendlyByteBuf;
|
||||
import net.minecraft.network.RegistryFriendlyByteBuf;
|
||||
@@ -27,7 +27,7 @@ import net.minecraft.network.codec.StreamCodec;
|
||||
import net.minecraft.world.item.crafting.*;
|
||||
|
||||
public class TestRecipeSerializer implements RecipeSerializer<CustomRecipe> {
|
||||
private static final Codec<CustomRecipe> CODEC = RecordCodecBuilder.create(instance ->
|
||||
private static final MapCodec<CustomRecipe> CODEC = RecordCodecBuilder.mapCodec(instance ->
|
||||
instance.group(CraftingBookCategory.CODEC.fieldOf("category")
|
||||
.orElse(CraftingBookCategory.MISC)
|
||||
.forGetter(CraftingRecipe::category)
|
||||
@@ -36,7 +36,7 @@ public class TestRecipeSerializer implements RecipeSerializer<CustomRecipe> {
|
||||
private static final StreamCodec<RegistryFriendlyByteBuf, CustomRecipe> STREAM_CODEC = StreamCodec.of(TestRecipeSerializer::toNetwork, TestRecipeSerializer::fromNetwork);
|
||||
|
||||
@Override
|
||||
public Codec<CustomRecipe> codec() {
|
||||
public MapCodec<CustomRecipe> codec() {
|
||||
return CODEC;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user