Skip to content

Commit

Permalink
Update to 24w14a
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <[email protected]>
  • Loading branch information
shedaniel committed Apr 5, 2024
1 parent d4f399c commit d19cb9a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public int hashCode(FluidStackImpl.Pair value) {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public static FluidStack readOptional(HolderLookup.Provider provider, CompoundTa
}

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() {
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@

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;
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)
Expand All @@ -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;
}

Expand Down

0 comments on commit d19cb9a

Please sign in to comment.