From 0f26153f0acadbf973c1c5464c54b3d9d87bbd2b Mon Sep 17 00:00:00 2001 From: IThundxr Date: Mon, 30 Dec 2024 08:01:04 -0500 Subject: [PATCH 01/10] Don't track fake player network addons (#3977) (#4331) * Don't track fake player network addons * Review feedback Co-authored-by: modmuss --- fabric-events-interaction-v0/build.gradle | 2 +- .../FakePlayerNetHandlerMixin.java | 28 +++++++++++++++++++ .../fabric-events-interaction-v0.mixins.json | 1 + .../src/main/resources/fabric.mod.json | 1 + .../networking/UntrackedNetworkHandler.java | 21 ++++++++++++++ .../ServerPlayNetworkHandlerMixin.java | 8 ++++-- 6 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/mixin/event/interaction/FakePlayerNetHandlerMixin.java create mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/UntrackedNetworkHandler.java diff --git a/fabric-events-interaction-v0/build.gradle b/fabric-events-interaction-v0/build.gradle index a2e684128..2a025c9e1 100644 --- a/fabric-events-interaction-v0/build.gradle +++ b/fabric-events-interaction-v0/build.gradle @@ -1,4 +1,4 @@ archivesBaseName = "fabric-events-interaction-v0" version = getSubprojectVersion(project) -moduleDependencies(project, ['fabric-api-base']) +moduleDependencies(project, ['fabric-api-base', 'fabric-networking-api-v1']) diff --git a/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/mixin/event/interaction/FakePlayerNetHandlerMixin.java b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/mixin/event/interaction/FakePlayerNetHandlerMixin.java new file mode 100644 index 000000000..476ea7174 --- /dev/null +++ b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/mixin/event/interaction/FakePlayerNetHandlerMixin.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.event.interaction; + +import org.spongepowered.asm.mixin.Mixin; + +import net.fabricmc.fabric.impl.networking.UntrackedNetworkHandler; + +// Connector: This class exists to implement UntrackedNetworkHandler for Forge's FakePlayerNetHandler +// to ensure Fabric's instanceof check would work +@SuppressWarnings("UnstableApiUsage") +@Mixin(targets = "net.minecraftforge.common.util.FakePlayer$FakePlayerNetHandler") +public class FakePlayerNetHandlerMixin implements UntrackedNetworkHandler { +} diff --git a/fabric-events-interaction-v0/src/main/resources/fabric-events-interaction-v0.mixins.json b/fabric-events-interaction-v0/src/main/resources/fabric-events-interaction-v0.mixins.json index c4739a5ff..366243998 100644 --- a/fabric-events-interaction-v0/src/main/resources/fabric-events-interaction-v0.mixins.json +++ b/fabric-events-interaction-v0/src/main/resources/fabric-events-interaction-v0.mixins.json @@ -3,6 +3,7 @@ "package": "net.fabricmc.fabric.mixin.event.interaction", "compatibilityLevel": "JAVA_16", "mixins": [ + "FakePlayerNetHandlerMixin", "ServerPlayerInteractionManagerMixin" ], "injectors": { diff --git a/fabric-events-interaction-v0/src/main/resources/fabric.mod.json b/fabric-events-interaction-v0/src/main/resources/fabric.mod.json index cc6234340..e86ca4915 100644 --- a/fabric-events-interaction-v0/src/main/resources/fabric.mod.json +++ b/fabric-events-interaction-v0/src/main/resources/fabric.mod.json @@ -18,6 +18,7 @@ "depends": { "fabricloader": ">=0.4.0", "fabric-api-base": "*", + "fabric-networking-api-v1": "*", "minecraft": ">=1.15-alpha.19.37.a" }, "entrypoints": { diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/UntrackedNetworkHandler.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/UntrackedNetworkHandler.java new file mode 100644 index 000000000..19f7be7f5 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/UntrackedNetworkHandler.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.impl.networking; + +// An internal marker interface used by the fake player API to prevent the network addon from being tracked. +public interface UntrackedNetworkHandler { +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java index 675ede32b..95848211f 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java @@ -34,6 +34,7 @@ import net.fabricmc.fabric.impl.networking.DisconnectPacketSource; import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; +import net.fabricmc.fabric.impl.networking.UntrackedNetworkHandler; import net.fabricmc.fabric.impl.networking.server.ServerPlayNetworkAddon; // We want to apply a bit earlier than other mods which may not use us in order to prevent refCount issues @@ -52,8 +53,11 @@ abstract class ServerPlayNetworkHandlerMixin implements NetworkHandlerExtensions @Inject(method = "", at = @At("RETURN")) private void initAddon(CallbackInfo ci) { this.addon = new ServerPlayNetworkAddon((ServerPlayNetworkHandler) (Object) this, this.server); - // A bit of a hack but it allows the field above to be set in case someone registers handlers during INIT event which refers to said field - this.addon.lateInit(); + + if (!(this instanceof UntrackedNetworkHandler)) { + // A bit of a hack but it allows the field above to be set in case someone registers handlers during INIT event which refers to said field + this.addon.lateInit(); + } } @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) From 4b4151c0e0d079fba3523ef48aeb7bfb8eb709b3 Mon Sep 17 00:00:00 2001 From: Cassian Godsted Date: Mon, 30 Dec 2024 08:01:15 -0500 Subject: [PATCH 02/10] Fix overriding vanilla translations (#4187) (#4335) (cherry picked from commit e82f21f7e92545027a4dec8081c1bcac860a8259) Co-authored-by: apple502j <33279053+apple502j@users.noreply.github.com> --- .../fabricmc/fabric/test/resource/loader/LanguageTestMod.java | 2 ++ .../src/testmod/resources/assets/minecraft/lang/en_us.json | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 fabric-resource-loader-v0/src/testmod/resources/assets/minecraft/lang/en_us.json diff --git a/fabric-resource-loader-v0/src/testmod/java/net/fabricmc/fabric/test/resource/loader/LanguageTestMod.java b/fabric-resource-loader-v0/src/testmod/java/net/fabricmc/fabric/test/resource/loader/LanguageTestMod.java index 92ff0799d..2d9252728 100644 --- a/fabric-resource-loader-v0/src/testmod/java/net/fabricmc/fabric/test/resource/loader/LanguageTestMod.java +++ b/fabric-resource-loader-v0/src/testmod/java/net/fabricmc/fabric/test/resource/loader/LanguageTestMod.java @@ -27,6 +27,8 @@ public static void onInitializeServer(ServerStartingEvent event) { } private static void testTranslationLoaded() { + testTranslationLoaded("item.minecraft.potato", "Potato"); // Test that vanilla translation loads + testTranslationLoaded("text.fabric-resource-loader-v0-testmod.server.lang.override", "Vanilla override test"); testTranslationLoaded("pack.source.fabricmod", "Fabric mod"); testTranslationLoaded("text.fabric-resource-loader-v0-testmod.server.lang.test0", "Test from fabric-resource-loader-v0-testmod"); testTranslationLoaded("text.fabric-resource-loader-v0-testmod.server.lang.test1", "Test from fabric-resource-loader-v0-testmod-test1"); diff --git a/fabric-resource-loader-v0/src/testmod/resources/assets/minecraft/lang/en_us.json b/fabric-resource-loader-v0/src/testmod/resources/assets/minecraft/lang/en_us.json new file mode 100644 index 000000000..3943934aa --- /dev/null +++ b/fabric-resource-loader-v0/src/testmod/resources/assets/minecraft/lang/en_us.json @@ -0,0 +1,3 @@ +{ + "text.fabric-resource-loader-v0-testmod.server.lang.override": "Vanilla override test" +} From 10fc97c09b035e3a2542390eee0867d98e00e9f4 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Mon, 30 Dec 2024 13:05:24 +0000 Subject: [PATCH 03/10] Bump version --- gradle.properties | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index 56b3bc56a..4db5fe3ef 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3500M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.92.2 +version=0.92.3 minecraft_version=1.20.1 yarn_version=+build.1 loader_version=0.14.21 @@ -20,34 +20,34 @@ fabric-blockrenderlayer-v1-version=1.1.41 fabric-command-api-v1-version=1.2.34 fabric-command-api-v2-version=2.2.13 fabric-commands-v0-version=0.2.51 -fabric-containers-v0-version=0.1.64 -fabric-content-registries-v0-version=4.0.11 +fabric-containers-v0-version=0.1.65 +fabric-content-registries-v0-version=4.0.12 fabric-crash-report-info-v1-version=0.2.19 -fabric-data-attachment-api-v1-version=1.0.0 -fabric-data-generation-api-v1-version=12.3.4 +fabric-data-attachment-api-v1-version=1.0.1 +fabric-data-generation-api-v1-version=12.3.5 fabric-dimensions-v1-version=2.1.54 fabric-entity-events-v1-version=1.6.0 -fabric-events-interaction-v0-version=0.6.2 +fabric-events-interaction-v0-version=0.6.3 fabric-events-lifecycle-v0-version=0.2.63 fabric-game-rule-api-v1-version=1.0.40 -fabric-gametest-api-v1-version=1.2.13 +fabric-gametest-api-v1-version=1.2.14 fabric-item-api-v1-version=2.1.28 -fabric-item-group-api-v1-version=4.0.12 +fabric-item-group-api-v1-version=4.0.13 fabric-key-binding-api-v1-version=1.0.37 fabric-keybindings-v0-version=0.2.35 fabric-lifecycle-events-v1-version=2.2.22 -fabric-loot-api-v2-version=1.2.1 -fabric-loot-tables-v1-version=1.1.45 +fabric-loot-api-v2-version=1.2.2 +fabric-loot-tables-v1-version=1.1.46 fabric-message-api-v1-version=5.1.9 -fabric-mining-level-api-v1-version=2.1.50 +fabric-mining-level-api-v1-version=2.1.51 fabric-model-loading-api-v1-version=1.0.3 fabric-models-v0-version=0.4.2 -fabric-networking-api-v1-version=1.3.11 -fabric-networking-v0-version=0.3.51 -fabric-object-builder-api-v1-version=11.1.3 +fabric-networking-api-v1-version=1.3.12 +fabric-networking-v0-version=0.3.52 +fabric-object-builder-api-v1-version=11.1.4 fabric-particles-v1-version=1.1.2 -fabric-recipe-api-v1-version=1.0.21 -fabric-registry-sync-v0-version=2.3.3 +fabric-recipe-api-v1-version=1.0.22 +fabric-registry-sync-v0-version=2.3.4 fabric-renderer-api-v1-version=3.2.1 fabric-renderer-indigo-version=1.5.2 fabric-renderer-registries-v1-version=3.2.46 @@ -56,9 +56,9 @@ fabric-rendering-fluids-v1-version=3.0.28 fabric-rendering-v0-version=1.1.49 fabric-rendering-v1-version=3.0.8 fabric-resource-conditions-api-v1-version=2.3.8 -fabric-resource-loader-v0-version=0.11.10 +fabric-resource-loader-v0-version=0.11.11 fabric-screen-api-v1-version=2.0.8 -fabric-screen-handler-api-v1-version=1.3.30 +fabric-screen-handler-api-v1-version=1.3.31 fabric-sound-api-v1-version=1.0.13 fabric-transfer-api-v1-version=3.3.5 fabric-transitive-access-wideners-v1-version=4.3.1 From f8c414ceae67c303a15359d230c9f052b10380c4 Mon Sep 17 00:00:00 2001 From: modmuss Date: Sun, 16 Mar 2025 13:12:47 +0000 Subject: [PATCH 04/10] Fix TypeAwareBuyForOneEmeraldFactory trade offer crash (#4492) * Fix TypeAwareBuyForOneEmeraldFactory trade offer crash (#4457) * Fix TypeAwareBuyForOneEmeraldFactory trade offer crash Fixes #4456 * Fix extra separation style issue * Fix style issues in EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest * Rename for clarity in TypeAwareBuyForOneEmeraldFactory mixin * Further clarify TypeAwareBuyForOneEmeraldFactory mixin docs (cherry picked from commit 38b0d598dabd4f54a67f919484b235a7f1e6efeb) * Update Fabric Loader * Update actions/upload-artifact * Fix? --------- Co-authored-by: Zoe <104020300+antikyth@users.noreply.github.com> --- ...TypeAwareBuyForOneEmeraldFactoryMixin.java | 39 ++++++----------- .../src/main/resources/fabric.mod.json | 2 +- ...areBuyForOneEmeraldTradeOfferGameTest.java | 43 +++++++++++++++++++ .../src/testmod/resources/fabric.mod.json | 3 +- gradle.properties | 2 +- gradle/ffapi-setup.gradle | 8 ++-- src/main/resources/fabric.mod.json | 2 +- 7 files changed, 65 insertions(+), 34 deletions(-) create mode 100644 fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest.java diff --git a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin.java b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin.java index df6856937..bcdfb2437 100644 --- a/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin.java +++ b/fabric-object-builder-api-v1/src/main/java/net/fabricmc/fabric/mixin/object/builder/TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin.java @@ -16,43 +16,30 @@ package net.fabricmc.fabric.mixin.object.builder; -import java.util.stream.Stream; - +import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.sugar.Cancellable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.random.Random; -import net.minecraft.registry.DefaultedRegistry; import net.minecraft.village.TradeOffer; import net.minecraft.village.TradeOffers; -import net.minecraft.village.VillagerType; @Mixin(TradeOffers.TypeAwareBuyForOneEmeraldFactory.class) public abstract class TradeOffersTypeAwareBuyForOneEmeraldFactoryMixin { /** - * Vanilla will check the "VillagerType -> Item" map in the stream and throw an exception for villager types not specified in the map. - * This breaks any and all custom villager types. - * We want to prevent this default logic so modded villager types will work. - * So we return an empty stream so an exception is never thrown. - */ - @Redirect(method = "", at = @At(value = "INVOKE", target = "Lnet/minecraft/registry/DefaultedRegistry;stream()Ljava/util/stream/Stream;"), require = 0) - private Stream disableVanillaCheck(DefaultedRegistry instance) { - return Stream.empty(); - } - - /** - * To prevent "item" -> "air" trades, if the result of a type aware trade is air, make sure no offer is created. + * To prevent crashes due to passing a {@code null} item to a {@link TradeOffer}, return a {@code null} trade offer + * early before {@code null} is passed to the constructor. */ - @Inject(method = "create", at = @At(value = "NEW", target = "net/minecraft/village/TradeOffer"), locals = LocalCapture.CAPTURE_FAILEXCEPTION, cancellable = true, require = 0) - private void failOnNullItem(Entity entity, Random random, CallbackInfoReturnable cir, ItemStack buyingItem) { - if (buyingItem.isEmpty()) { // Will return true for an "empty" item stack that had null passed in the ctor - cir.setReturnValue(null); // Return null to prevent creation of empty trades + @ModifyExpressionValue( + method = "create", + at = @At(value = "INVOKE", target = "Ljava/util/Map;get(Ljava/lang/Object;)Ljava/lang/Object;") + ) + private Object failOnNullItem(Object item, @Cancellable CallbackInfoReturnable cir) { + if (item == null) { + cir.setReturnValue(null); } + + return item; } } diff --git a/fabric-object-builder-api-v1/src/main/resources/fabric.mod.json b/fabric-object-builder-api-v1/src/main/resources/fabric.mod.json index 156455342..470e19b4a 100644 --- a/fabric-object-builder-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-object-builder-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.8.2", + "fabricloader": ">=0.16.10", "fabric-api-base": "*" }, "description": "Builders for objects vanilla has locked down.", diff --git a/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest.java b/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest.java new file mode 100644 index 000000000..4357bdecd --- /dev/null +++ b/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.test.object.builder; + +import com.google.common.collect.ImmutableMap; +import org.jetbrains.annotations.NotNull; + +import net.minecraft.entity.EntityType; +import net.minecraft.entity.passive.VillagerEntity; +import net.minecraft.test.TestContext; +import net.minecraft.util.math.random.Random; +import net.minecraft.village.TradeOffers; +import net.minecraft.village.VillagerType; + +//import net.fabricmc.fabric.api.gametest.v1.FabricGameTest; + +public class EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest { +// @GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE) + public void testEmptyTypeAwareTradeOffer(@NotNull TestContext context) { + VillagerEntity villager = new VillagerEntity(EntityType.VILLAGER, context.getWorld(), VillagerType.PLAINS); + + // Create a type-aware trade offer with no villager types specified + TradeOffers.Factory typeAwareFactory = new TradeOffers.TypeAwareBuyForOneEmeraldFactory(1, 12, 5, ImmutableMap.of()); + // Create an offer with that factory to ensure it doesn't crash when a villager type is missing from the map + typeAwareFactory.create(villager, Random.create()); + + context.complete(); + } +} diff --git a/fabric-object-builder-api-v1/src/testmod/resources/fabric.mod.json b/fabric-object-builder-api-v1/src/testmod/resources/fabric.mod.json index c611f8d2f..06b6142f2 100644 --- a/fabric-object-builder-api-v1/src/testmod/resources/fabric.mod.json +++ b/fabric-object-builder-api-v1/src/testmod/resources/fabric.mod.json @@ -32,7 +32,8 @@ "net.fabricmc.fabric.test.object.builder.client.TealSignClientTest" ], "fabric-gametest": [ - "net.fabricmc.fabric.test.object.builder.ObjectBuilderGameTest" + "net.fabricmc.fabric.test.object.builder.ObjectBuilderGameTest", + "net.fabricmc.fabric.test.object.builder.EmptyTypeAwareBuyForOneEmeraldTradeOfferGameTest" ] } } diff --git a/gradle.properties b/gradle.properties index 4db5fe3ef..a6e50cd38 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ fabric.loom.multiProjectOptimisation=true version=0.92.3 minecraft_version=1.20.1 yarn_version=+build.1 -loader_version=0.14.21 +loader_version=0.16.10 installer_version=0.11.1 prerelease=false diff --git a/gradle/ffapi-setup.gradle b/gradle/ffapi-setup.gradle index b7dec16bb..c416f02b9 100644 --- a/gradle/ffapi-setup.gradle +++ b/gradle/ffapi-setup.gradle @@ -202,7 +202,7 @@ dependencies { // Include Forgified Fabric Loader include "dev.su5ed.sinytra:fabric-loader:${rootProject.forge_fabric_loader_version}:full" - include implementation("io.github.llamalad7:mixinextras-forge:0.3.5") + include implementation("io.github.llamalad7:mixinextras-forge:0.4.1") } afterEvaluate { javadoc { @@ -265,9 +265,9 @@ subprojects { baseLib } dependencies { - compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.3.5")) - implementation("io.github.llamalad7:mixinextras-forge:0.3.5") - testmodImplementation("io.github.llamalad7:mixinextras-forge:0.3.5") + compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.4.1")) + implementation("io.github.llamalad7:mixinextras-forge:0.4.1") + testmodImplementation("io.github.llamalad7:mixinextras-forge:0.4.1") baseLib "net.fabricmc:fabric-loader:${rootProject.loader_version}" } def compareJar = tasks.register("compareJar", Jar) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4ea32c18d..c05f80b58 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,7 +19,7 @@ "Sinytra" ], "depends": { - "fabricloader": ">=0.14.21", + "fabricloader": ">=0.16.10", "java": ">=17", "minecraft": ">=1.20 <1.20.2-" }, From 22893d566434369c968c87fe100e09dc13eb08f4 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sun, 16 Mar 2025 13:14:27 +0000 Subject: [PATCH 05/10] Bump versions All modules bumped due to higher loader requirement. --- gradle.properties | 108 +++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/gradle.properties b/gradle.properties index a6e50cd38..171320f61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3500M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.92.3 +version=0.92.4 minecraft_version=1.20.1 yarn_version=+build.1 loader_version=0.16.10 @@ -11,59 +11,59 @@ installer_version=0.11.1 prerelease=false # Do not manually update, use the bumpversions task: -fabric-api-base-version=0.4.31 -fabric-api-lookup-api-v1-version=1.6.36 -fabric-biome-api-v1-version=13.0.13 -fabric-block-api-v1-version=1.0.11 -fabric-block-view-api-v2-version=1.0.1 -fabric-blockrenderlayer-v1-version=1.1.41 -fabric-command-api-v1-version=1.2.34 -fabric-command-api-v2-version=2.2.13 -fabric-commands-v0-version=0.2.51 -fabric-containers-v0-version=0.1.65 -fabric-content-registries-v0-version=4.0.12 -fabric-crash-report-info-v1-version=0.2.19 -fabric-data-attachment-api-v1-version=1.0.1 -fabric-data-generation-api-v1-version=12.3.5 -fabric-dimensions-v1-version=2.1.54 -fabric-entity-events-v1-version=1.6.0 -fabric-events-interaction-v0-version=0.6.3 -fabric-events-lifecycle-v0-version=0.2.63 -fabric-game-rule-api-v1-version=1.0.40 -fabric-gametest-api-v1-version=1.2.14 -fabric-item-api-v1-version=2.1.28 -fabric-item-group-api-v1-version=4.0.13 -fabric-key-binding-api-v1-version=1.0.37 -fabric-keybindings-v0-version=0.2.35 -fabric-lifecycle-events-v1-version=2.2.22 -fabric-loot-api-v2-version=1.2.2 -fabric-loot-tables-v1-version=1.1.46 -fabric-message-api-v1-version=5.1.9 -fabric-mining-level-api-v1-version=2.1.51 -fabric-model-loading-api-v1-version=1.0.3 -fabric-models-v0-version=0.4.2 -fabric-networking-api-v1-version=1.3.12 -fabric-networking-v0-version=0.3.52 -fabric-object-builder-api-v1-version=11.1.4 -fabric-particles-v1-version=1.1.2 -fabric-recipe-api-v1-version=1.0.22 -fabric-registry-sync-v0-version=2.3.4 -fabric-renderer-api-v1-version=3.2.1 -fabric-renderer-indigo-version=1.5.2 -fabric-renderer-registries-v1-version=3.2.46 -fabric-rendering-data-attachment-v1-version=0.3.37 -fabric-rendering-fluids-v1-version=3.0.28 -fabric-rendering-v0-version=1.1.49 -fabric-rendering-v1-version=3.0.8 -fabric-resource-conditions-api-v1-version=2.3.8 -fabric-resource-loader-v0-version=0.11.11 -fabric-screen-api-v1-version=2.0.8 -fabric-screen-handler-api-v1-version=1.3.31 -fabric-sound-api-v1-version=1.0.13 -fabric-transfer-api-v1-version=3.3.5 -fabric-transitive-access-wideners-v1-version=4.3.1 -fabric-convention-tags-v1-version=1.5.5 -fabric-client-tags-api-v1-version=1.1.2 +fabric-api-base-version=0.4.32 +fabric-api-lookup-api-v1-version=1.6.37 +fabric-biome-api-v1-version=13.0.14 +fabric-block-api-v1-version=1.0.12 +fabric-block-view-api-v2-version=1.0.2 +fabric-blockrenderlayer-v1-version=1.1.42 +fabric-command-api-v1-version=1.2.35 +fabric-command-api-v2-version=2.2.14 +fabric-commands-v0-version=0.2.52 +fabric-containers-v0-version=0.1.66 +fabric-content-registries-v0-version=4.0.13 +fabric-crash-report-info-v1-version=0.2.20 +fabric-data-attachment-api-v1-version=1.0.2 +fabric-data-generation-api-v1-version=12.3.6 +fabric-dimensions-v1-version=2.1.55 +fabric-entity-events-v1-version=1.6.1 +fabric-events-interaction-v0-version=0.6.4 +fabric-events-lifecycle-v0-version=0.2.64 +fabric-game-rule-api-v1-version=1.0.41 +fabric-gametest-api-v1-version=1.2.15 +fabric-item-api-v1-version=2.1.29 +fabric-item-group-api-v1-version=4.0.14 +fabric-key-binding-api-v1-version=1.0.38 +fabric-keybindings-v0-version=0.2.36 +fabric-lifecycle-events-v1-version=2.2.23 +fabric-loot-api-v2-version=1.2.3 +fabric-loot-tables-v1-version=1.1.47 +fabric-message-api-v1-version=5.1.10 +fabric-mining-level-api-v1-version=2.1.52 +fabric-model-loading-api-v1-version=1.0.4 +fabric-models-v0-version=0.4.3 +fabric-networking-api-v1-version=1.3.13 +fabric-networking-v0-version=0.3.53 +fabric-object-builder-api-v1-version=11.1.5 +fabric-particles-v1-version=1.1.3 +fabric-recipe-api-v1-version=1.0.23 +fabric-registry-sync-v0-version=2.3.5 +fabric-renderer-api-v1-version=3.2.2 +fabric-renderer-indigo-version=1.5.3 +fabric-renderer-registries-v1-version=3.2.47 +fabric-rendering-data-attachment-v1-version=0.3.38 +fabric-rendering-fluids-v1-version=3.0.29 +fabric-rendering-v0-version=1.1.50 +fabric-rendering-v1-version=3.0.9 +fabric-resource-conditions-api-v1-version=2.3.9 +fabric-resource-loader-v0-version=0.11.12 +fabric-screen-api-v1-version=2.0.9 +fabric-screen-handler-api-v1-version=1.3.32 +fabric-sound-api-v1-version=1.0.14 +fabric-transfer-api-v1-version=3.3.6 +fabric-transitive-access-wideners-v1-version=4.3.2 +fabric-convention-tags-v1-version=1.5.6 +fabric-client-tags-api-v1-version=1.1.3 # FFAPI Properties loom.platform=forge From 53347ba99b4ee49ba79dde929b72dcd7828d21c2 Mon Sep 17 00:00:00 2001 From: modmuss Date: Wed, 19 Mar 2025 09:19:58 +0000 Subject: [PATCH 06/10] Fix BlockView API v2 not applying WorldViewMixin (#4500) (#4512) (cherry picked from commit 9c49cc8ce12d0046cbf7051cf6debacff0511616) (cherry picked from commit aa6d566c45cba70a0a7128e4dbdbf5cd8ac5c3ad) Co-authored-by: PepperCode1 <44146161+PepperCode1@users.noreply.github.com> --- .../src/main/resources/fabric-block-view-api-v2.mixins.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.mixins.json b/fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.mixins.json index bbd819000..19534443e 100644 --- a/fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.mixins.json +++ b/fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.mixins.json @@ -4,7 +4,8 @@ "compatibilityLevel": "JAVA_17", "mixins": [ "BlockEntityMixin", - "BlockViewMixin" + "BlockViewMixin", + "WorldViewMixin" ], "injectors": { "defaultRequire": 1 From b6dedc59bb0daa2f8639c0eec94f11813f64e0b0 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 19 Mar 2025 09:30:22 +0000 Subject: [PATCH 07/10] Bump version --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 171320f61..4158aaa9f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3500M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.92.4 +version=0.92.5 minecraft_version=1.20.1 yarn_version=+build.1 loader_version=0.16.10 @@ -15,7 +15,7 @@ fabric-api-base-version=0.4.32 fabric-api-lookup-api-v1-version=1.6.37 fabric-biome-api-v1-version=13.0.14 fabric-block-api-v1-version=1.0.12 -fabric-block-view-api-v2-version=1.0.2 +fabric-block-view-api-v2-version=1.0.3 fabric-blockrenderlayer-v1-version=1.1.42 fabric-command-api-v1-version=1.2.35 fabric-command-api-v2-version=2.2.14 @@ -51,7 +51,7 @@ fabric-registry-sync-v0-version=2.3.5 fabric-renderer-api-v1-version=3.2.2 fabric-renderer-indigo-version=1.5.3 fabric-renderer-registries-v1-version=3.2.47 -fabric-rendering-data-attachment-v1-version=0.3.38 +fabric-rendering-data-attachment-v1-version=0.3.39 fabric-rendering-fluids-v1-version=3.0.29 fabric-rendering-v0-version=1.1.50 fabric-rendering-v1-version=3.0.9 From fb7c82268953657dfa877942c3a0746a2acce9b6 Mon Sep 17 00:00:00 2001 From: Dawn Date: Sat, 31 May 2025 10:21:44 -0300 Subject: [PATCH 08/10] Fix #4487 for 1.20.1 (#4654) * backport fakeplayer memory leak fix to 1.20.1 * fix checkstyle violations * Less risky change --------- Co-authored-by: modmuss50 --- .../impl/networking/server/ServerPlayNetworkAddon.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java index 395fa1b32..d4d05f531 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java @@ -33,6 +33,7 @@ import net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon; import net.fabricmc.fabric.impl.networking.ChannelInfoHolder; import net.fabricmc.fabric.impl.networking.NetworkingImpl; +import net.fabricmc.fabric.impl.networking.UntrackedNetworkHandler; import net.fabricmc.fabric.mixin.networking.accessor.CustomPayloadC2SPacketAccessor; import net.fabricmc.fabric.mixin.networking.accessor.ServerPlayNetworkHandlerAccessor; @@ -49,8 +50,10 @@ public ServerPlayNetworkAddon(ServerPlayNetworkHandler handler, MinecraftServer // Must register pending channels via lateinit this.registerPendingChannels((ChannelInfoHolder) this.connection); - // Register global receivers and attach to session - this.receiver.startSession(this); + if (!(handler instanceof UntrackedNetworkHandler)) { + // Register global receivers and attach to session + this.receiver.startSession(this); + } } @Override From 9116b46cd1ecfdf6f31642bed8bd050bebd44329 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 31 May 2025 14:22:51 +0100 Subject: [PATCH 09/10] Bump version --- gradle.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gradle.properties b/gradle.properties index 4158aaa9f..c44e81bda 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3500M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.92.5 +version=0.92.6 minecraft_version=1.20.1 yarn_version=+build.1 loader_version=0.16.10 @@ -20,14 +20,14 @@ fabric-blockrenderlayer-v1-version=1.1.42 fabric-command-api-v1-version=1.2.35 fabric-command-api-v2-version=2.2.14 fabric-commands-v0-version=0.2.52 -fabric-containers-v0-version=0.1.66 +fabric-containers-v0-version=0.1.67 fabric-content-registries-v0-version=4.0.13 fabric-crash-report-info-v1-version=0.2.20 fabric-data-attachment-api-v1-version=1.0.2 -fabric-data-generation-api-v1-version=12.3.6 +fabric-data-generation-api-v1-version=12.3.7 fabric-dimensions-v1-version=2.1.55 fabric-entity-events-v1-version=1.6.1 -fabric-events-interaction-v0-version=0.6.4 +fabric-events-interaction-v0-version=0.6.5 fabric-events-lifecycle-v0-version=0.2.64 fabric-game-rule-api-v1-version=1.0.41 fabric-gametest-api-v1-version=1.2.15 @@ -42,12 +42,12 @@ fabric-message-api-v1-version=5.1.10 fabric-mining-level-api-v1-version=2.1.52 fabric-model-loading-api-v1-version=1.0.4 fabric-models-v0-version=0.4.3 -fabric-networking-api-v1-version=1.3.13 -fabric-networking-v0-version=0.3.53 +fabric-networking-api-v1-version=1.3.14 +fabric-networking-v0-version=0.3.54 fabric-object-builder-api-v1-version=11.1.5 fabric-particles-v1-version=1.1.3 -fabric-recipe-api-v1-version=1.0.23 -fabric-registry-sync-v0-version=2.3.5 +fabric-recipe-api-v1-version=1.0.24 +fabric-registry-sync-v0-version=2.3.6 fabric-renderer-api-v1-version=3.2.2 fabric-renderer-indigo-version=1.5.3 fabric-renderer-registries-v1-version=3.2.47 @@ -58,7 +58,7 @@ fabric-rendering-v1-version=3.0.9 fabric-resource-conditions-api-v1-version=2.3.9 fabric-resource-loader-v0-version=0.11.12 fabric-screen-api-v1-version=2.0.9 -fabric-screen-handler-api-v1-version=1.3.32 +fabric-screen-handler-api-v1-version=1.3.33 fabric-sound-api-v1-version=1.0.14 fabric-transfer-api-v1-version=3.3.6 fabric-transitive-access-wideners-v1-version=4.3.2 From 698002052253be1e5e5faa24dac0e40e4ee1920f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZX=E5=A4=8F=E5=A4=9C=E4=B9=8B=E9=A3=8E?= Date: Wed, 13 Aug 2025 18:15:53 +0800 Subject: [PATCH 10/10] Update to Forge 47.4.6 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c44e81bda..4a2986665 100644 --- a/gradle.properties +++ b/gradle.properties @@ -67,7 +67,7 @@ fabric-client-tags-api-v1-version=1.1.3 # FFAPI Properties loom.platform=forge -forge_version=1.20.1-47.3.27 +forge_version=1.20.1-47.4.6 pack_format=15 forgified_version=1.11.12 forge_fabric_loader_version=2.6.0+0.15.0+1.20.1