From a063365e487dac7216aa0963fada12ffca0e611c Mon Sep 17 00:00:00 2001 From: Josiah Glosson Date: Mon, 16 Dec 2024 08:39:40 -0600 Subject: [PATCH] Update Fabric API --- .../io/github/gaming32/bingo/data/goal/GoalManager.java | 7 ++----- common/src/main/resources/bingo.accessWidener | 2 -- fabric/src/main/resources/fabric.mod.json | 2 +- gradle.properties | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java b/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java index a94a34f2..48e5df71 100644 --- a/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java +++ b/common/src/main/java/io/github/gaming32/bingo/data/goal/GoalManager.java @@ -2,11 +2,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.mojang.serialization.JsonOps; import io.github.gaming32.bingo.Bingo; +import io.github.gaming32.bingo.data.BingoRegistries; import io.github.gaming32.bingo.util.ResourceLocations; import net.minecraft.core.HolderLookup; -import net.minecraft.resources.FileToIdConverter; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener; @@ -26,9 +25,7 @@ public class GoalManager extends SimpleJsonResourceReloadListener { private static Map> goalsByDifficulty = Map.of(); public GoalManager(HolderLookup.Provider registries) { - // FIXME: Switch to (HolderLookup.Provider, Codec, ResourceKey) overload and remove the AW once - // https://github.com/FabricMC/fabric/pull/4180 is merged - super(registries.createSerializationContext(JsonOps.INSTANCE), BingoGoal.CODEC, FileToIdConverter.json("bingo/goal")); + super(registries, BingoGoal.CODEC, BingoRegistries.GOAL); } public static Set getGoalIds() { diff --git a/common/src/main/resources/bingo.accessWidener b/common/src/main/resources/bingo.accessWidener index d6ae529b..06a46892 100644 --- a/common/src/main/resources/bingo.accessWidener +++ b/common/src/main/resources/bingo.accessWidener @@ -6,8 +6,6 @@ accessible method net/minecraft/client/gui/GuiGraphics renderTooltipInternal (Ln accessible method net/minecraft/commands/arguments/ResourceKeyArgument getRegistryKey (Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;Lnet/minecraft/resources/ResourceKey;Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;)Lnet/minecraft/resources/ResourceKey; accessible method net/minecraft/commands/arguments/ResourceKeyArgument resolveKey (Lcom/mojang/brigadier/context/CommandContext;Ljava/lang/String;Lnet/minecraft/resources/ResourceKey;Lcom/mojang/brigadier/exceptions/DynamicCommandExceptionType;)Lnet/minecraft/core/Holder$Reference; -extendable method net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener (Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/Codec;Lnet/minecraft/resources/FileToIdConverter;)V - accessible method net/minecraft/world/level/storage/loot/parameters/LootContextParamSets register (Ljava/lang/String;Ljava/util/function/Consumer;)Lnet/minecraft/util/context/ContextKeySet; accessible field net/minecraft/world/inventory/GrindstoneMenu repairSlots Lnet/minecraft/world/Container; diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index c3ad2a71..24fba46e 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -40,7 +40,7 @@ ], "depends": { "fabricloader": ">=0.16.9", - "fabric-api": ">=0.111.0", + "fabric-api": ">=0.112.1", "minecraft": ">=1.21.4 <1.21.5" }, "custom": { diff --git a/gradle.properties b/gradle.properties index 216316c4..e6b23316 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,6 +7,6 @@ mod_version=1.1.12 maven_group=io.github.gaming32 fabric_loader_version=0.16.9 -fabric_api_version=0.111.0+1.21.4 +fabric_api_version=0.112.1+1.21.4 neoforge_version=21.4.1-beta