From 0af3f5a7020b2fe1c37286ae2e18332c7276e4f0 Mon Sep 17 00:00:00 2001 From: modmuss Date: Sat, 4 May 2024 14:28:29 +0100 Subject: [PATCH] 24w18a (#3757) Co-authored-by: Drex --- build.gradle | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/datagen/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../test/tag/convention/v2/TagUtilTest.java | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../FabricBlockLootTableProvider.java | 4 +- .../v1/provider/FabricLanguageProvider.java | 5 +- .../v1/provider/FabricRecipeProvider.java | 1 + .../v1/provider/FabricTagProvider.java | 6 - .../ConditionBlockLootTableGenerator.java | 3 +- .../loot/FabricLootTableProviderImpl.java | 2 +- .../loot/BlockLootTableGeneratorAccessor.java | 29 +++++ ...abric-data-generation-api-v1.accesswidener | 10 +- .../fabric-data-generation-api-v1.mixins.json | 7 +- .../src/main/resources/fabric.mod.json | 2 +- .../datagen/DataGeneratorTestEntrypoint.java | 5 +- .../template.accesswidener | 6 - .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../fabric/api/item/v1/EnchantmentEvents.java | 5 +- .../fabric/api/item/v1/FabricItem.java | 5 +- .../fabric/api/item/v1/FabricItemStack.java | 5 +- .../item/AbstractFurnaceBlockEntityMixin.java | 2 +- .../mixin/item/AnvilScreenHandlerMixin.java | 6 +- .../mixin/item/EnchantCommandMixin.java | 9 +- .../EnchantRandomlyLootFunctionMixin.java | 7 +- .../mixin/item/EnchantmentHelperMixin.java | 9 +- .../fabric/mixin/item/ItemStackMixin.java | 8 +- .../fabric/mixin/item/RecipeMixin.java | 10 +- .../src/main/resources/fabric.mod.json | 2 +- .../fabric/test/item/CustomDamageTest.java | 23 ++-- .../test/item/ItemUpdateAnimationTest.java | 6 +- .../test/item/gametest/RecipeGameTest.java | 22 ++-- .../mixin/itemgroup/ItemGroupMixin.java | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../builtin/ComponentsIngredient.java | 6 +- .../ingredient/ShapelessRecipeMixin.java | 12 +- .../src/main/resources/fabric.mod.json | 2 +- .../ingredient/ShapelessRecipeMatchTests.java | 32 ++---- .../registry/sync/DynamicRegistriesImpl.java | 4 +- .../registry/sync/FabricRegistryInit.java | 12 -- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../client/rendering/InGameHudMixin.java | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../loader/SimpleResourceReloadMixin.java | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../src/main/resources/fabric.mod.json | 2 +- .../src/client/resources/fabric.mod.json | 2 +- .../v1/storage/base/ResourceAmount.java | 2 +- .../transfer/item/InventorySlotWrapper.java | 4 +- .../src/main/resources/fabric.mod.json | 2 +- .../test/transfer/unittests/FluidTests.java | 6 +- .../test/transfer/unittests/ItemTests.java | 6 +- .../SingleVariantItemStorageTests.java | 6 +- .../src/main/resources/fabric.mod.json | 2 +- gradle.properties | 108 +++++++++--------- src/main/resources/fabric.mod.json | 4 +- 91 files changed, 262 insertions(+), 245 deletions(-) create mode 100644 fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/mixin/datagen/loot/BlockLootTableGeneratorAccessor.java diff --git a/build.gradle b/build.gradle index ddcc981b79..943369364a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { id "idea" id "maven-publish" id 'jacoco' - id "fabric-loom" version "1.6.5" apply false + id "fabric-loom" version "1.6.11" apply false id "com.diffplug.spotless" version "6.20.0" id "org.ajoberstar.grgit" version "3.1.0" id "me.modmuss50.remotesign" version "0.4.0" apply false diff --git a/deprecated/fabric-command-api-v1/src/main/resources/fabric.mod.json b/deprecated/fabric-command-api-v1/src/main/resources/fabric.mod.json index 097097357a..0474c0ae54 100644 --- a/deprecated/fabric-command-api-v1/src/main/resources/fabric.mod.json +++ b/deprecated/fabric-command-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-command-api-v2": "*" }, diff --git a/deprecated/fabric-commands-v0/src/main/resources/fabric.mod.json b/deprecated/fabric-commands-v0/src/main/resources/fabric.mod.json index 39ceaa6620..b285ac02c0 100644 --- a/deprecated/fabric-commands-v0/src/main/resources/fabric.mod.json +++ b/deprecated/fabric-commands-v0/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-command-api-v2": "*" }, diff --git a/deprecated/fabric-convention-tags-v1/src/main/resources/fabric.mod.json b/deprecated/fabric-convention-tags-v1/src/main/resources/fabric.mod.json index 5490f990a6..ac6e109c3b 100644 --- a/deprecated/fabric-convention-tags-v1/src/main/resources/fabric.mod.json +++ b/deprecated/fabric-convention-tags-v1/src/main/resources/fabric.mod.json @@ -21,7 +21,7 @@ ] }, "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.18.2" }, "description": "Contains common tags used by mods for vanilla things.", diff --git a/deprecated/fabric-keybindings-v0/src/client/resources/fabric.mod.json b/deprecated/fabric-keybindings-v0/src/client/resources/fabric.mod.json index ebd883469f..b8bee105d4 100644 --- a/deprecated/fabric-keybindings-v0/src/client/resources/fabric.mod.json +++ b/deprecated/fabric-keybindings-v0/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-key-binding-api-v1": "*" }, "description": "Keybinding registry API.", diff --git a/deprecated/fabric-models-v0/src/client/resources/fabric.mod.json b/deprecated/fabric-models-v0/src/client/resources/fabric.mod.json index 648d05c8af..37ef8f0773 100644 --- a/deprecated/fabric-models-v0/src/client/resources/fabric.mod.json +++ b/deprecated/fabric-models-v0/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-model-loading-api-v1": "*" }, diff --git a/deprecated/fabric-renderer-registries-v1/src/client/resources/fabric.mod.json b/deprecated/fabric-renderer-registries-v1/src/client/resources/fabric.mod.json index e39e719590..347b64c7ca 100644 --- a/deprecated/fabric-renderer-registries-v1/src/client/resources/fabric.mod.json +++ b/deprecated/fabric-renderer-registries-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.15-alpha.19.39.a", "fabric-api-base": "*", "fabric-rendering-v1": "*" diff --git a/deprecated/fabric-rendering-data-attachment-v1/src/main/resources/fabric.mod.json b/deprecated/fabric-rendering-data-attachment-v1/src/main/resources/fabric.mod.json index 482a7c9acb..37986bbf6f 100644 --- a/deprecated/fabric-rendering-data-attachment-v1/src/main/resources/fabric.mod.json +++ b/deprecated/fabric-rendering-data-attachment-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-block-view-api-v2": "*" }, "description": "Thread-safe hooks for block entity data use during terrain rendering.", diff --git a/deprecated/fabric-rendering-v0/src/client/resources/fabric.mod.json b/deprecated/fabric-rendering-v0/src/client/resources/fabric.mod.json index 970f2d7082..cd1d4895bb 100644 --- a/deprecated/fabric-rendering-v0/src/client/resources/fabric.mod.json +++ b/deprecated/fabric-rendering-v0/src/client/resources/fabric.mod.json @@ -21,7 +21,7 @@ ] }, "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.15-alpha.19.39.a", "fabric-api-base": "*", "fabric-rendering-v1": "*" diff --git a/fabric-api-base/src/main/resources/fabric.mod.json b/fabric-api-base/src/main/resources/fabric.mod.json index f9fc0d6c31..df43201051 100644 --- a/fabric-api-base/src/main/resources/fabric.mod.json +++ b/fabric-api-base/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Contains the essentials for Fabric API modules.", "custom": { diff --git a/fabric-api-lookup-api-v1/src/main/resources/fabric.mod.json b/fabric-api-lookup-api-v1/src/main/resources/fabric.mod.json index 45253cfbd6..02be22d220 100644 --- a/fabric-api-lookup-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-api-lookup-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-lifecycle-events-v1": "*" }, diff --git a/fabric-biome-api-v1/src/main/resources/fabric.mod.json b/fabric-biome-api-v1/src/main/resources/fabric.mod.json index f965de4b70..750c8fb3dc 100644 --- a/fabric-biome-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-biome-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.16.2" }, "description": "Hooks for adding biomes to the default world generator.", diff --git a/fabric-block-api-v1/src/main/resources/fabric.mod.json b/fabric-block-api-v1/src/main/resources/fabric.mod.json index 62e4236c87..9124464cc7 100644 --- a/fabric-block-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-block-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "entrypoints": { }, diff --git a/fabric-block-view-api-v2/src/main/resources/fabric.mod.json b/fabric-block-view-api-v2/src/main/resources/fabric.mod.json index 3788e8b941..4aa54dac7e 100644 --- a/fabric-block-view-api-v2/src/main/resources/fabric.mod.json +++ b/fabric-block-view-api-v2/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Hooks for block views", "mixins": [ diff --git a/fabric-blockrenderlayer-v1/src/client/resources/fabric.mod.json b/fabric-blockrenderlayer-v1/src/client/resources/fabric.mod.json index 6ec7d972d9..a8967e540c 100644 --- a/fabric-blockrenderlayer-v1/src/client/resources/fabric.mod.json +++ b/fabric-blockrenderlayer-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.15-alpha.19.38.b", "fabric-api-base": "*" }, diff --git a/fabric-client-tags-api-v1/src/client/resources/fabric.mod.json b/fabric-client-tags-api-v1/src/client/resources/fabric.mod.json index fc25980958..5e55ddbe9b 100644 --- a/fabric-client-tags-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-client-tags-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Adds the ability to load tags from the local mods.", "custom": { diff --git a/fabric-command-api-v2/src/main/resources/fabric.mod.json b/fabric-command-api-v2/src/main/resources/fabric.mod.json index 2e075191d7..587357e29d 100644 --- a/fabric-command-api-v2/src/main/resources/fabric.mod.json +++ b/fabric-command-api-v2/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "minecraft": ">1.19-alpha.22.11.a" }, diff --git a/fabric-content-registries-v0/src/main/resources/fabric.mod.json b/fabric-content-registries-v0/src/main/resources/fabric.mod.json index 8820f2a842..ab6e48035a 100644 --- a/fabric-content-registries-v0/src/main/resources/fabric.mod.json +++ b/fabric-content-registries-v0/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-lifecycle-events-v1": "*", "fabric-resource-loader-v0": "*" diff --git a/fabric-convention-tags-v2/src/datagen/resources/fabric.mod.json b/fabric-convention-tags-v2/src/datagen/resources/fabric.mod.json index 45fa2a6a53..1d24ae61ae 100644 --- a/fabric-convention-tags-v2/src/datagen/resources/fabric.mod.json +++ b/fabric-convention-tags-v2/src/datagen/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.18.2" }, "description": "Contains common tags used by mods for vanilla things.", diff --git a/fabric-convention-tags-v2/src/main/resources/fabric.mod.json b/fabric-convention-tags-v2/src/main/resources/fabric.mod.json index 02fa0e0dcc..a82d6a0a27 100644 --- a/fabric-convention-tags-v2/src/main/resources/fabric.mod.json +++ b/fabric-convention-tags-v2/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.20.5-beta.1", "fabric-lifecycle-events-v1": "*" }, diff --git a/fabric-convention-tags-v2/src/testmod/java/net/fabricmc/fabric/test/tag/convention/v2/TagUtilTest.java b/fabric-convention-tags-v2/src/testmod/java/net/fabricmc/fabric/test/tag/convention/v2/TagUtilTest.java index cd8b4accbf..ef4640c826 100644 --- a/fabric-convention-tags-v2/src/testmod/java/net/fabricmc/fabric/test/tag/convention/v2/TagUtilTest.java +++ b/fabric-convention-tags-v2/src/testmod/java/net/fabricmc/fabric/test/tag/convention/v2/TagUtilTest.java @@ -37,7 +37,7 @@ public class TagUtilTest implements ModInitializer { @Override public void onInitialize() { ServerLifecycleEvents.SERVER_STARTED.register(server -> { - if (!TagUtil.isIn(ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, Enchantments.FORTUNE)) { + if (!TagUtil.isIn(server.getRegistryManager(), ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, server.getRegistryManager().get(RegistryKeys.ENCHANTMENT).get(Enchantments.FORTUNE))) { throw new AssertionError("Failed to find fortune in c:increase_block_drops!"); } diff --git a/fabric-crash-report-info-v1/src/main/resources/fabric.mod.json b/fabric-crash-report-info-v1/src/main/resources/fabric.mod.json index 75a6d47b08..fe7f6df8f6 100644 --- a/fabric-crash-report-info-v1/src/main/resources/fabric.mod.json +++ b/fabric-crash-report-info-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Adds Fabric-related debug info to crash reports.", "mixins": [ diff --git a/fabric-data-attachment-api-v1/src/main/resources/fabric.mod.json b/fabric-data-attachment-api-v1/src/main/resources/fabric.mod.json index ee82f417c4..c8c4867301 100644 --- a/fabric-data-attachment-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-data-attachment-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-entity-events-v1": "*", "fabric-object-builder-api-v1": "*" }, diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricBlockLootTableProvider.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricBlockLootTableProvider.java index b8a498b023..5e8fe8c820 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricBlockLootTableProvider.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricBlockLootTableProvider.java @@ -52,7 +52,7 @@ public abstract class FabricBlockLootTableProvider extends BlockLootTableGenerat private final CompletableFuture registryLookup; protected FabricBlockLootTableProvider(FabricDataOutput dataOutput, CompletableFuture registryLookup) { - super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet()); + super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet(), registryLookup.join()); this.output = dataOutput; this.registryLookup = registryLookup; } @@ -73,7 +73,7 @@ public void excludeFromStrictValidation(Block block) { } @Override - public void accept(RegistryWrapper.WrapperLookup registryLookup, BiConsumer, LootTable.Builder> biConsumer) { + public void accept(BiConsumer, LootTable.Builder> biConsumer) { generate(); for (Map.Entry, LootTable.Builder> entry : lootTables.entrySet()) { diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java index dff21b0619..a3f201a612 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricLanguageProvider.java @@ -47,6 +47,7 @@ import net.minecraft.text.TextContent; import net.minecraft.text.TranslatableTextContent; import net.minecraft.util.Identifier; +import net.minecraft.util.Util; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; @@ -184,8 +185,8 @@ default void add(EntityType entityType, String value) { * @param enchantment The {@link Enchantment} to get the translation key from. * @param value The value of the entry. */ - default void add(Enchantment enchantment, String value) { - add(enchantment.getTranslationKey(), value); + default void addEnchantment(RegistryKey enchantment, String value) { + add(Util.createTranslationKey("enchantment", enchantment.getValue()), value); } /** diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricRecipeProvider.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricRecipeProvider.java index 99d2dcf322..8678efc0d2 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricRecipeProvider.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricRecipeProvider.java @@ -114,6 +114,7 @@ public void accept(Identifier recipeId, Recipe recipe, @Nullable AdvancementE @Override public Advancement.Builder getAdvancementBuilder() { + //noinspection removal return Advancement.Builder.createUntelemetered().parent(CraftingRecipeJsonBuilder.ROOT); } }); diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java index fd72db51c3..cac205fc07 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricTagProvider.java @@ -212,12 +212,6 @@ public abstract static class EnchantmentTagProvider extends FabricTagProvider completableFuture) { super(output, RegistryKeys.ENCHANTMENT, completableFuture); } - - @Override - protected RegistryKey reverseLookup(Enchantment element) { - return Registries.ENCHANTMENT.getKey(element) - .orElseThrow(() -> new IllegalArgumentException("Enchantment " + element + " is not registered")); - } } /** diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/ConditionBlockLootTableGenerator.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/ConditionBlockLootTableGenerator.java index 6af5c4fdc9..e50911f284 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/ConditionBlockLootTableGenerator.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/ConditionBlockLootTableGenerator.java @@ -25,13 +25,14 @@ import net.fabricmc.fabric.api.resource.conditions.v1.ResourceCondition; import net.fabricmc.fabric.impl.datagen.FabricDataGenHelper; +import net.fabricmc.fabric.mixin.datagen.loot.BlockLootTableGeneratorAccessor; public class ConditionBlockLootTableGenerator extends BlockLootTableGenerator { private final BlockLootTableGenerator parent; private final ResourceCondition[] conditions; public ConditionBlockLootTableGenerator(BlockLootTableGenerator parent, ResourceCondition[] conditions) { - super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet()); + super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet(), ((BlockLootTableGeneratorAccessor) parent).getRegistryLookup()); this.parent = parent; this.conditions = conditions; diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/FabricLootTableProviderImpl.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/FabricLootTableProviderImpl.java index 9cbe6bc7d8..a1faf2553e 100644 --- a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/FabricLootTableProviderImpl.java +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/impl/datagen/loot/FabricLootTableProviderImpl.java @@ -58,7 +58,7 @@ public static CompletableFuture run( HashMap conditionMap = new HashMap<>(); return registryLookup.thenCompose(lookup -> { - provider.accept(lookup, (registryKey, builder) -> { + provider.accept((registryKey, builder) -> { ResourceCondition[] conditions = FabricDataGenHelper.consumeConditions(builder); conditionMap.put(registryKey.getValue(), conditions); diff --git a/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/mixin/datagen/loot/BlockLootTableGeneratorAccessor.java b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/mixin/datagen/loot/BlockLootTableGeneratorAccessor.java new file mode 100644 index 0000000000..2ea425f5fc --- /dev/null +++ b/fabric-data-generation-api-v1/src/main/java/net/fabricmc/fabric/mixin/datagen/loot/BlockLootTableGeneratorAccessor.java @@ -0,0 +1,29 @@ +/* + * 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.datagen.loot; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import net.minecraft.data.server.loottable.BlockLootTableGenerator; +import net.minecraft.registry.RegistryWrapper; + +@Mixin(BlockLootTableGenerator.class) +public interface BlockLootTableGeneratorAccessor { + @Accessor() + RegistryWrapper.WrapperLookup getRegistryLookup(); +} diff --git a/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.accesswidener b/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.accesswidener index 0e1f0a51e1..39d359be15 100644 --- a/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.accesswidener +++ b/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.accesswidener @@ -54,13 +54,7 @@ transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$B transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$LogTexturePool transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$BuiltinModelPool -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder; transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH_OR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH_NOR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator SAPLING_DROP_CHANCE [F -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator LEAVES_STICK_DROP_CHANCE [F ### Generated access wideners below @@ -259,6 +253,10 @@ transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator registerRoots (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;)V transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator addJigsawOrientationToVariant (Lnet/minecraft/block/enums/Orientation;Lnet/minecraft/data/client/BlockStateVariant;)Lnet/minecraft/data/client/BlockStateVariant; transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator registerCandle (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;)V +transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder; +transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder; +transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder; +transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder; transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator applyExplosionDecay (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/function/LootFunctionConsumingBuilder;)Lnet/minecraft/loot/function/LootFunctionConsumingBuilder; transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator addSurvivesExplosionCondition (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/condition/LootConditionConsumingBuilder;)Lnet/minecraft/loot/condition/LootConditionConsumingBuilder; transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator drops (Lnet/minecraft/block/Block;Lnet/minecraft/loot/condition/LootCondition$Builder;Lnet/minecraft/loot/entry/LootPoolEntry$Builder;)Lnet/minecraft/loot/LootTable$Builder; diff --git a/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.mixins.json b/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.mixins.json index 76fd2a15b6..c8d44bcde1 100644 --- a/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.mixins.json +++ b/fabric-data-generation-api-v1/src/main/resources/fabric-data-generation-api-v1.mixins.json @@ -3,11 +3,12 @@ "package": "net.fabricmc.fabric.mixin.datagen", "compatibilityLevel": "JAVA_17", "mixins": [ - "loot.BlockLootTableGeneratorMixin", "DataProviderMixin", - "TagProviderMixin", "ModelProviderMixin", - "TagBuilderMixin" + "TagBuilderMixin", + "TagProviderMixin", + "loot.BlockLootTableGeneratorAccessor", + "loot.BlockLootTableGeneratorMixin" ], "server": [ "server.MainMixin" diff --git a/fabric-data-generation-api-v1/src/main/resources/fabric.mod.json b/fabric-data-generation-api-v1/src/main/resources/fabric.mod.json index 8d4f3391ad..da1f324454 100644 --- a/fabric-data-generation-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-data-generation-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Allows for automatic data generation.", "mixins": [ diff --git a/fabric-data-generation-api-v1/src/testmod/java/net/fabricmc/fabric/test/datagen/DataGeneratorTestEntrypoint.java b/fabric-data-generation-api-v1/src/testmod/java/net/fabricmc/fabric/test/datagen/DataGeneratorTestEntrypoint.java index 557e91a40a..77b2f375cd 100644 --- a/fabric-data-generation-api-v1/src/testmod/java/net/fabricmc/fabric/test/datagen/DataGeneratorTestEntrypoint.java +++ b/fabric-data-generation-api-v1/src/testmod/java/net/fabricmc/fabric/test/datagen/DataGeneratorTestEntrypoint.java @@ -58,7 +58,6 @@ import net.minecraft.loot.LootTables; import net.minecraft.loot.condition.BlockStatePropertyLootCondition; import net.minecraft.loot.condition.LootCondition; -import net.minecraft.loot.condition.LootConditionTypes; import net.minecraft.loot.context.LootContextTypes; import net.minecraft.loot.entry.ItemEntry; import net.minecraft.loot.provider.number.ConstantLootNumberProvider; @@ -403,7 +402,7 @@ private TestBarterLootTableProvider(FabricDataOutput output, CompletableFuture, LootTable.Builder> consumer) { + public void accept(BiConsumer, LootTable.Builder> consumer) { withConditions(consumer, ALWAYS_LOADED).accept( LootTables.PIGLIN_BARTERING_GAMEPLAY, LootTable.builder().pool( @@ -435,7 +434,7 @@ public String getName() { private static class TestPredicateProvider extends FabricCodecDataProvider { private TestPredicateProvider(FabricDataOutput dataOutput, CompletableFuture registriesFuture) { - super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK, "predicates", LootConditionTypes.CODEC); + super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK, "predicates", LootCondition.CODEC); } @Override diff --git a/fabric-data-generation-api-v1/template.accesswidener b/fabric-data-generation-api-v1/template.accesswidener index 80d56b0625..f33966285a 100644 --- a/fabric-data-generation-api-v1/template.accesswidener +++ b/fabric-data-generation-api-v1/template.accesswidener @@ -49,12 +49,6 @@ transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$B transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$LogTexturePool transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$BuiltinModelPool -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder; transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH_OR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH_NOR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder; -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator SAPLING_DROP_CHANCE [F -transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator LEAVES_STICK_DROP_CHANCE [F ### Generated access wideners below diff --git a/fabric-dimensions-v1/src/main/resources/fabric.mod.json b/fabric-dimensions-v1/src/main/resources/fabric.mod.json index da60bb51f1..298b69754a 100644 --- a/fabric-dimensions-v1/src/main/resources/fabric.mod.json +++ b/fabric-dimensions-v1/src/main/resources/fabric.mod.json @@ -15,7 +15,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.16-rc.3", "fabric-api-base": "*" }, diff --git a/fabric-entity-events-v1/src/main/resources/fabric.mod.json b/fabric-entity-events-v1/src/main/resources/fabric.mod.json index 0b80630a96..56e3e4bc2c 100644 --- a/fabric-entity-events-v1/src/main/resources/fabric.mod.json +++ b/fabric-entity-events-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Events to hook into entities.", "mixins": [ 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 bb9842c70a..b21378c4d4 100644 --- a/fabric-events-interaction-v0/src/main/resources/fabric.mod.json +++ b/fabric-events-interaction-v0/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "minecraft": ">=1.15-alpha.19.37.a" }, diff --git a/fabric-game-rule-api-v1/src/main/resources/fabric.mod.json b/fabric-game-rule-api-v1/src/main/resources/fabric.mod.json index c6d024d9da..4a80d52ac2 100644 --- a/fabric-game-rule-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-game-rule-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Allows registration of custom game rules.", "mixins": [ diff --git a/fabric-gametest-api-v1/src/main/resources/fabric.mod.json b/fabric-gametest-api-v1/src/main/resources/fabric.mod.json index 020b78e639..05517327cd 100644 --- a/fabric-gametest-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-gametest-api-v1/src/main/resources/fabric.mod.json @@ -21,7 +21,7 @@ ] }, "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-resource-loader-v0": "*" }, "description": "Allows registration of custom game tests.", diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentEvents.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentEvents.java index 5f624ff6ac..3779d6ae5d 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentEvents.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/EnchantmentEvents.java @@ -18,6 +18,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.fabricmc.fabric.api.event.Event; import net.fabricmc.fabric.api.event.EventFactory; @@ -44,7 +45,7 @@ private EnchantmentEvents() { } *

Note that allowing an enchantment using this event does not guarantee the item will receive that enchantment, * only that it isn't forbidden from doing so.

* - * @see AllowEnchanting#allowEnchanting(Enchantment, ItemStack, EnchantingContext) + * @see AllowEnchanting#allowEnchanting(RegistryEntry, ItemStack, EnchantingContext) * @see Enchantment#isAcceptableItem(ItemStack) * @see FabricItem#canBeEnchantedWith(ItemStack, Enchantment, EnchantingContext) */ @@ -76,7 +77,7 @@ public interface AllowEnchanting { * @see EnchantingContext */ TriState allowEnchanting( - Enchantment enchantment, + RegistryEntry enchantment, ItemStack target, EnchantingContext enchantingContext ); diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java index a029eb09f7..6d67f512fe 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItem.java @@ -21,6 +21,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.util.Hand; import net.fabricmc.fabric.impl.item.FabricItemInternals; @@ -124,8 +125,8 @@ default ItemStack getRecipeRemainder(ItemStack stack) { * @param context the context in which the enchantment is being checked * @return whether the enchantment is allowed to apply to the stack */ - default boolean canBeEnchantedWith(ItemStack stack, Enchantment enchantment, EnchantingContext context) { - return enchantment.isAcceptableItem(stack); + default boolean canBeEnchantedWith(ItemStack stack, RegistryEntry enchantment, EnchantingContext context) { + return enchantment.value().isAcceptableItem(stack); } /** diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java index 50c3959a25..6d3f61c645 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/api/item/v1/FabricItemStack.java @@ -19,6 +19,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.fabricmc.fabric.api.util.TriState; @@ -49,9 +50,9 @@ default ItemStack getRecipeRemainder() { * @param enchantment the enchantment to check * @param context the context in which the enchantment is being checked * @return whether the enchantment is allowed to apply to the stack - * @see FabricItem#canBeEnchantedWith(ItemStack, Enchantment, EnchantingContext) + * @see FabricItem#canBeEnchantedWith(ItemStack, RegistryEntry, EnchantingContext) */ - default boolean canBeEnchantedWith(Enchantment enchantment, EnchantingContext context) { + default boolean canBeEnchantedWith(RegistryEntry enchantment, EnchantingContext context) { TriState result = EnchantmentEvents.ALLOW_ENCHANTING.invoker().allowEnchanting( enchantment, (ItemStack) this, diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java index 3f197499ee..680f710ba7 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AbstractFurnaceBlockEntityMixin.java @@ -37,7 +37,7 @@ public abstract class AbstractFurnaceBlockEntityMixin { private static final ThreadLocal REMAINDER_STACK = new ThreadLocal<>(); @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), locals = LocalCapture.CAPTURE_FAILHARD, allow = 1) - private static void getStackRemainder(World world, BlockPos pos, BlockState state, AbstractFurnaceBlockEntity blockEntity, CallbackInfo ci, boolean bl, boolean bl2, ItemStack itemStack, boolean bl3, boolean bl4, RecipeEntry recipe, int i) { + private static void getStackRemainder(World world, BlockPos pos, BlockState state, AbstractFurnaceBlockEntity blockEntity, CallbackInfo ci, boolean bl, boolean bl2, ItemStack itemStack, ItemStack itemStack2, boolean bl3, boolean bl4, RecipeEntry recipeEntry, int i) { REMAINDER_STACK.set(itemStack.getRecipeRemainder()); } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AnvilScreenHandlerMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AnvilScreenHandlerMixin.java index 15771f78ea..91a94562a1 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AnvilScreenHandlerMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/AnvilScreenHandlerMixin.java @@ -16,6 +16,7 @@ package net.fabricmc.fabric.mixin.item; +import com.llamalad7.mixinextras.sugar.Local; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -24,6 +25,7 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.screen.AnvilScreenHandler; import net.minecraft.screen.ForgingScreenHandler; import net.minecraft.screen.ScreenHandlerContext; @@ -44,7 +46,7 @@ abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler { target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z" ) ) - private boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) { - return stack.canBeEnchantedWith(instance, EnchantingContext.ANVIL); + private boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack, @Local RegistryEntry registryEntry) { + return stack.canBeEnchantedWith(registryEntry, EnchantingContext.ANVIL); } } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantCommandMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantCommandMixin.java index 2f945c282e..aa33ca5fc3 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantCommandMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantCommandMixin.java @@ -16,13 +16,18 @@ package net.fabricmc.fabric.mixin.item; +import java.util.Collection; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; import net.minecraft.enchantment.Enchantment; +import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.command.EnchantCommand; +import net.minecraft.server.command.ServerCommandSource; import net.fabricmc.fabric.api.item.v1.EnchantingContext; @@ -32,7 +37,7 @@ abstract class EnchantCommandMixin { method = "execute", at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z") ) - private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) { - return stack.canBeEnchantedWith(instance, EnchantingContext.ENCHANT_COMMAND); + private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack, ServerCommandSource source, Collection targets, RegistryEntry enchantment) { + return stack.canBeEnchantedWith(enchantment, EnchantingContext.ENCHANT_COMMAND); } } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantRandomlyLootFunctionMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantRandomlyLootFunctionMixin.java index d884bb01b3..0c0843e1ad 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantRandomlyLootFunctionMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantRandomlyLootFunctionMixin.java @@ -23,16 +23,17 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; import net.minecraft.loot.function.EnchantRandomlyLootFunction; +import net.minecraft.registry.entry.RegistryEntry; import net.fabricmc.fabric.api.item.v1.EnchantingContext; @Mixin(EnchantRandomlyLootFunction.class) abstract class EnchantRandomlyLootFunctionMixin { @Redirect( - method = "method_53327", + method = "method_60291", at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z") ) - private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) { - return stack.canBeEnchantedWith(instance, EnchantingContext.LOOT_RANDOM_ENCHANTMENT); + private static boolean callAllowEnchantingEvent(Enchantment enchantment, ItemStack stack, boolean bl, ItemStack itemStack, RegistryEntry registryEntry) { + return stack.canBeEnchantedWith(registryEntry, EnchantingContext.LOOT_RANDOM_ENCHANTMENT); } } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantmentHelperMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantmentHelperMixin.java index b06fe3284d..af36177af4 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantmentHelperMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/EnchantmentHelperMixin.java @@ -23,16 +23,17 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.ItemStack; +import net.minecraft.registry.entry.RegistryEntry; import net.fabricmc.fabric.api.item.v1.EnchantingContext; @Mixin(EnchantmentHelper.class) abstract class EnchantmentHelperMixin { @Redirect( - method = "getPossibleEntries", - at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z") + method = "method_60143", + at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isPrimaryItem(Lnet/minecraft/item/ItemStack;)Z") ) - private static boolean useCustomEnchantingChecks(Enchantment instance, ItemStack stack) { - return stack.canBeEnchantedWith(instance, EnchantingContext.RANDOM_ENCHANTMENT); + private static boolean useCustomEnchantingChecks(Enchantment instance, ItemStack stack, ItemStack itemStack, boolean bl, RegistryEntry registryEntry) { + return stack.canBeEnchantedWith(registryEntry, EnchantingContext.RANDOM_ENCHANTMENT); } } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/ItemStackMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/ItemStackMixin.java index 16c89c0b04..6c9992a930 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/ItemStackMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/ItemStackMixin.java @@ -28,7 +28,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.math.random.Random; +import net.minecraft.server.world.ServerWorld; import net.fabricmc.fabric.api.item.v1.CustomDamageHandler; import net.fabricmc.fabric.api.item.v1.FabricItemStack; @@ -38,8 +38,8 @@ public abstract class ItemStackMixin implements FabricItemStack { @Shadow public abstract Item getItem(); - @WrapOperation(method = "damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/util/math/random/Random;Lnet/minecraft/server/network/ServerPlayerEntity;Ljava/lang/Runnable;)V")) - private void hookDamage(ItemStack instance, int amount, Random random, ServerPlayerEntity serverPlayerEntity, Runnable runnable, Operation original, @Local(argsOnly = true) EquipmentSlot slot) { + @WrapOperation(method = "damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/server/world/ServerWorld;Lnet/minecraft/server/network/ServerPlayerEntity;Ljava/lang/Runnable;)V")) + private void hookDamage(ItemStack instance, int amount, ServerWorld serverWorld, ServerPlayerEntity serverPlayerEntity, Runnable runnable, Operation original, @Local(argsOnly = true) EquipmentSlot slot) { CustomDamageHandler handler = ((ItemExtensions) getItem()).fabric_getCustomDamageHandler(); if (handler != null) { @@ -54,6 +54,6 @@ private void hookDamage(ItemStack instance, int amount, Random random, ServerPla if (mut.booleanValue()) return; } - original.call(instance, amount, random, serverPlayerEntity, runnable); + original.call(instance, amount, serverWorld, serverPlayerEntity, runnable); } } diff --git a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/RecipeMixin.java b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/RecipeMixin.java index b7da96eec2..d2b9275fea 100644 --- a/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/RecipeMixin.java +++ b/fabric-item-api-v1/src/main/java/net/fabricmc/fabric/mixin/item/RecipeMixin.java @@ -23,20 +23,20 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import net.minecraft.inventory.Inventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.recipe.Recipe; +import net.minecraft.recipe.input.RecipeInput; import net.minecraft.util.collection.DefaultedList; import net.fabricmc.fabric.impl.item.RecipeRemainderHandler; @Mixin(Recipe.class) -public interface RecipeMixin { - @Inject(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;"), locals = LocalCapture.CAPTURE_FAILHARD) - default void captureStack(C inventory, CallbackInfoReturnable> cir, DefaultedList defaultedList, int i) { - RecipeRemainderHandler.REMAINDER_STACK.set(inventory.getStack(i).getRecipeRemainder()); +public interface RecipeMixin { + @Inject(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/recipe/input/RecipeInput;getStackInSlot(I)Lnet/minecraft/item/ItemStack;"), locals = LocalCapture.CAPTURE_FAILHARD) + default void captureStack(T inventory, CallbackInfoReturnable> cir, DefaultedList defaultedList, int i) { + RecipeRemainderHandler.REMAINDER_STACK.set(inventory.getStackInSlot(i).getRecipeRemainder()); } @Redirect(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;hasRecipeRemainder()Z")) diff --git a/fabric-item-api-v1/src/main/resources/fabric.mod.json b/fabric-item-api-v1/src/main/resources/fabric.mod.json index 58b935dd6e..57c971e298 100644 --- a/fabric-item-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-item-api-v1/src/main/resources/fabric.mod.json @@ -23,7 +23,7 @@ } ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Hooks for items", diff --git a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java index 80389272f7..d0fbc2f759 100644 --- a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java +++ b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/CustomDamageTest.java @@ -16,7 +16,7 @@ package net.fabricmc.fabric.test.item; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; @@ -29,6 +29,7 @@ import net.minecraft.potion.Potions; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.text.Text; import net.minecraft.util.Identifier; import net.minecraft.util.dynamic.Codecs; @@ -42,8 +43,8 @@ import net.fabricmc.fabric.api.util.TriState; public class CustomDamageTest implements ModInitializer { - public static final DataComponentType WEIRD = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "weird"), - DataComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); + public static final ComponentType WEIRD = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "weird"), + ComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); public static final CustomDamageHandler WEIRD_DAMAGE_HANDLER = (stack, amount, entity, slot, breakCallback) -> { // If sneaking, apply all damage to vanilla. Otherwise, increment a tag on the stack by one and don't apply any damage if (entity.isSneaking()) { @@ -62,9 +63,17 @@ public void onInitialize() { FuelRegistry.INSTANCE.add(WEIRD_PICK, 200); FabricBrewingRecipeRegistryBuilder.BUILD.register(builder -> builder.registerPotionRecipe(Potions.WATER, WEIRD_PICK, Potions.AWKWARD)); EnchantmentEvents.ALLOW_ENCHANTING.register(((enchantment, target, enchantingContext) -> { - if (target.isOf(Items.DIAMOND_PICKAXE) - && enchantment == Enchantments.SHARPNESS - && EnchantmentHelper.hasSilkTouch(target)) { + // TODO 1.21 this is clearly wrong + boolean hasSilkTouch = false; + + for (RegistryEntry entry : EnchantmentHelper.getEnchantments(target).getEnchantments()) { + if (entry.getKey().orElse(null) == Enchantments.SILK_TOUCH) { + hasSilkTouch = true; + break; + } + } + + if (target.isOf(Items.DIAMOND_PICKAXE) && enchantment == Enchantments.SHARPNESS && hasSilkTouch) { return TriState.TRUE; } @@ -96,7 +105,7 @@ public ItemStack getRecipeRemainder(ItemStack stack) { } @Override - public boolean canBeEnchantedWith(ItemStack stack, Enchantment enchantment, EnchantingContext context) { + public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry enchantment, EnchantingContext context) { return context == EnchantingContext.ANVIL && enchantment == Enchantments.FIRE_ASPECT || enchantment != Enchantments.FORTUNE && super.canBeEnchantedWith(stack, enchantment, context); } diff --git a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ItemUpdateAnimationTest.java b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ItemUpdateAnimationTest.java index 57877b64e7..dc49727cbd 100644 --- a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ItemUpdateAnimationTest.java +++ b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/ItemUpdateAnimationTest.java @@ -16,7 +16,7 @@ package net.fabricmc.fabric.test.item; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.network.codec.PacketCodecs; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; @@ -26,8 +26,8 @@ import net.fabricmc.api.ModInitializer; public class ItemUpdateAnimationTest implements ModInitializer { - public static final DataComponentType TICKS = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "ticks"), - DataComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); + public static final ComponentType TICKS = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "ticks"), + ComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); @Override public void onInitialize() { diff --git a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/RecipeGameTest.java b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/RecipeGameTest.java index 2c02b3ae7a..e996476969 100644 --- a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/RecipeGameTest.java +++ b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/RecipeGameTest.java @@ -16,12 +16,14 @@ package net.fabricmc.fabric.test.item.gametest; -import net.minecraft.inventory.SimpleInventory; +import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.RecipeType; +import net.minecraft.recipe.input.CraftingRecipeInput; import net.minecraft.registry.RegistryWrapper; import net.minecraft.test.GameTest; import net.minecraft.test.GameTestException; @@ -35,11 +37,11 @@ public class RecipeGameTest implements FabricGameTest { @GameTest(templateName = EMPTY_STRUCTURE) public void vanillaRemainderTest(TestContext context) { - Recipe testRecipe = createTestingRecipeInstance(); + Recipe testRecipe = createTestingRecipeInstance(); - SimpleInventory inventory = new SimpleInventory( + CraftingRecipeInput inventory = CraftingRecipeInput.create(1, 2, List.of( new ItemStack(Items.WATER_BUCKET), - new ItemStack(Items.DIAMOND)); + new ItemStack(Items.DIAMOND))); DefaultedList remainderList = testRecipe.getRemainder(inventory); @@ -52,13 +54,13 @@ public void vanillaRemainderTest(TestContext context) { @GameTest(templateName = EMPTY_STRUCTURE) public void fabricRemainderTest(TestContext context) { - Recipe testRecipe = createTestingRecipeInstance(); + Recipe testRecipe = createTestingRecipeInstance(); - SimpleInventory inventory = new SimpleInventory( + CraftingRecipeInput inventory = CraftingRecipeInput.create(1, 4, List.of( new ItemStack(CustomDamageTest.WEIRD_PICK), withDamage(new ItemStack(CustomDamageTest.WEIRD_PICK), 10), withDamage(new ItemStack(CustomDamageTest.WEIRD_PICK), 31), - new ItemStack(Items.DIAMOND)); + new ItemStack(Items.DIAMOND))); DefaultedList remainderList = testRecipe.getRemainder(inventory); @@ -71,15 +73,15 @@ public void fabricRemainderTest(TestContext context) { context.complete(); } - private Recipe createTestingRecipeInstance() { + private Recipe createTestingRecipeInstance() { return new Recipe<>() { @Override - public boolean matches(SimpleInventory inventory, World world) { + public boolean matches(CraftingRecipeInput recipeInput, World world) { return true; } @Override - public ItemStack craft(SimpleInventory inventory, RegistryWrapper.WrapperLookup wrapperLookup) { + public ItemStack craft(CraftingRecipeInput recipeInput, RegistryWrapper.WrapperLookup wrapperLookup) { return null; } diff --git a/fabric-item-group-api-v1/src/main/java/net/fabricmc/fabric/mixin/itemgroup/ItemGroupMixin.java b/fabric-item-group-api-v1/src/main/java/net/fabricmc/fabric/mixin/itemgroup/ItemGroupMixin.java index 0418ac7f42..a3fa72964f 100644 --- a/fabric-item-group-api-v1/src/main/java/net/fabricmc/fabric/mixin/itemgroup/ItemGroupMixin.java +++ b/fabric-item-group-api-v1/src/main/java/net/fabricmc/fabric/mixin/itemgroup/ItemGroupMixin.java @@ -52,7 +52,7 @@ abstract class ItemGroupMixin implements FabricItemGroup { private int fabric_page = -1; @SuppressWarnings("ConstantConditions") - @Inject(method = "updateEntries", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemGroup;reloadSearchProvider()V")) + @Inject(method = "updateEntries", at = @At("TAIL")) public void getStacks(ItemGroup.DisplayContext context, CallbackInfo ci) { final ItemGroup self = (ItemGroup) (Object) this; final RegistryKey registryKey = Registries.ITEM_GROUP.getKey(self).orElseThrow(() -> new IllegalStateException("Unregistered item group : " + self)); diff --git a/fabric-item-group-api-v1/src/main/resources/fabric.mod.json b/fabric-item-group-api-v1/src/main/resources/fabric.mod.json index 287004e244..67a084a2de 100644 --- a/fabric-item-group-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-item-group-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-resource-loader-v0": "*" }, diff --git a/fabric-key-binding-api-v1/src/client/resources/fabric.mod.json b/fabric-key-binding-api-v1/src/client/resources/fabric.mod.json index 32f8c20097..1eb9e55422 100644 --- a/fabric-key-binding-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-key-binding-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Key Binding registry API.", "mixins": [ diff --git a/fabric-lifecycle-events-v1/src/main/resources/fabric.mod.json b/fabric-lifecycle-events-v1/src/main/resources/fabric.mod.json index f8df6dfc45..2d6b32b421 100644 --- a/fabric-lifecycle-events-v1/src/main/resources/fabric.mod.json +++ b/fabric-lifecycle-events-v1/src/main/resources/fabric.mod.json @@ -31,7 +31,7 @@ } ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Events for the game's lifecycle.", diff --git a/fabric-loot-api-v2/src/main/resources/fabric.mod.json b/fabric-loot-api-v2/src/main/resources/fabric.mod.json index 48aacd450f..9f766e6428 100644 --- a/fabric-loot-api-v2/src/main/resources/fabric.mod.json +++ b/fabric-loot-api-v2/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-resource-loader-v0": "*" }, diff --git a/fabric-message-api-v1/src/main/resources/fabric.mod.json b/fabric-message-api-v1/src/main/resources/fabric.mod.json index 8c519a3345..064c93b981 100644 --- a/fabric-message-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-message-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Adds message-related hooks.", diff --git a/fabric-model-loading-api-v1/src/client/resources/fabric.mod.json b/fabric-model-loading-api-v1/src/client/resources/fabric.mod.json index dfd80a1eda..dfb3e1cab3 100644 --- a/fabric-model-loading-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-model-loading-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "breaks": { diff --git a/fabric-networking-api-v1/src/main/resources/fabric.mod.json b/fabric-networking-api-v1/src/main/resources/fabric.mod.json index 2c9982b431..e3753b1a4c 100644 --- a/fabric-networking-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-networking-api-v1/src/main/resources/fabric.mod.json @@ -26,7 +26,7 @@ }, "accessWidener": "fabric-networking-api-v1.accesswidener", "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Low-level, vanilla protocol oriented networking hooks.", 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 8aa8fb234f..3bee3c5cde 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.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Builders for objects vanilla has locked down.", diff --git a/fabric-particles-v1/src/main/resources/fabric.mod.json b/fabric-particles-v1/src/main/resources/fabric.mod.json index 4c8d51c721..fe85771ff1 100644 --- a/fabric-particles-v1/src/main/resources/fabric.mod.json +++ b/fabric-particles-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Hooks for registering custom particles.", "mixins": [ diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java index a9ca0fefea..03eeb12357 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/impl/recipe/ingredient/builtin/ComponentsIngredient.java @@ -28,7 +28,7 @@ import org.jetbrains.annotations.Nullable; import net.minecraft.component.ComponentChanges; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.item.ItemStack; import net.minecraft.network.RegistryByteBuf; import net.minecraft.network.codec.PacketCodec; @@ -58,8 +58,8 @@ public boolean test(ItemStack stack) { if (!base.test(stack)) return false; // None strict matching - for (Map.Entry, Optional> entry : components.entrySet()) { - final DataComponentType type = entry.getKey(); + for (Map.Entry, Optional> entry : components.entrySet()) { + final ComponentType type = entry.getKey(); final Optional value = entry.getValue(); if (value.isPresent()) { diff --git a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/mixin/recipe/ingredient/ShapelessRecipeMixin.java b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/mixin/recipe/ingredient/ShapelessRecipeMixin.java index 72471eee48..436b75b3fe 100644 --- a/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/mixin/recipe/ingredient/ShapelessRecipeMixin.java +++ b/fabric-recipe-api-v1/src/main/java/net/fabricmc/fabric/mixin/recipe/ingredient/ShapelessRecipeMixin.java @@ -28,11 +28,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.ShapelessRecipe; import net.minecraft.recipe.book.CraftingRecipeCategory; +import net.minecraft.recipe.input.CraftingRecipeInput; import net.minecraft.util.collection.DefaultedList; import net.minecraft.world.World; @@ -56,13 +56,13 @@ private void cacheRequiresTesting(String group, CraftingRecipeCategory category, } } - @Inject(at = @At("HEAD"), method = "matches", cancellable = true) - public void customIngredientMatch(RecipeInputInventory craftingInventory, World world, CallbackInfoReturnable cir) { + @Inject(at = @At("HEAD"), method = "matches(Lnet/minecraft/recipe/input/CraftingRecipeInput;Lnet/minecraft/world/World;)Z", cancellable = true) + public void customIngredientMatch(CraftingRecipeInput recipeInput, World world, CallbackInfoReturnable cir) { if (fabric_requiresTesting) { - List nonEmptyStacks = new ArrayList<>(craftingInventory.size()); + List nonEmptyStacks = new ArrayList<>(recipeInput.getStackCount()); - for (int i = 0; i < craftingInventory.size(); ++i) { - ItemStack stack = craftingInventory.getStack(i); + for (int i = 0; i < recipeInput.getStackCount(); ++i) { + ItemStack stack = recipeInput.getStackInSlot(i); if (!stack.isEmpty()) { nonEmptyStacks.add(stack); diff --git a/fabric-recipe-api-v1/src/main/resources/fabric.mod.json b/fabric-recipe-api-v1/src/main/resources/fabric.mod.json index c928d1856f..07ae00369d 100644 --- a/fabric-recipe-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-recipe-api-v1/src/main/resources/fabric.mod.json @@ -20,7 +20,7 @@ ], "accessWidener": "fabric-recipe-api-v1.accesswidener", "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-networking-api-v1": "*" }, "entrypoints": { diff --git a/fabric-recipe-api-v1/src/testmod/java/net/fabricmc/fabric/test/recipe/ingredient/ShapelessRecipeMatchTests.java b/fabric-recipe-api-v1/src/testmod/java/net/fabricmc/fabric/test/recipe/ingredient/ShapelessRecipeMatchTests.java index 085502c541..af7ce0ae0f 100644 --- a/fabric-recipe-api-v1/src/testmod/java/net/fabricmc/fabric/test/recipe/ingredient/ShapelessRecipeMatchTests.java +++ b/fabric-recipe-api-v1/src/testmod/java/net/fabricmc/fabric/test/recipe/ingredient/ShapelessRecipeMatchTests.java @@ -16,12 +16,14 @@ package net.fabricmc.fabric.test.recipe.ingredient; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.CraftingInventory; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.recipe.ShapelessRecipe; -import net.minecraft.screen.ScreenHandler; +import net.minecraft.recipe.input.CraftingRecipeInput; import net.minecraft.test.GameTest; import net.minecraft.test.GameTestException; import net.minecraft.test.TestContext; @@ -42,30 +44,16 @@ public void testShapelessMatch(TestContext context) { ItemStack damagedPickaxe = new ItemStack(Items.DIAMOND_PICKAXE); damagedPickaxe.setDamage(100); - CraftingInventory craftingInv = new CraftingInventory(new ScreenHandler(null, 0) { - @Override - public ItemStack quickMove(PlayerEntity player, int slot) { - return ItemStack.EMPTY; - } - - @Override - public boolean canUse(PlayerEntity player) { - return false; - } - }, 3, 3); - - // Test that damaged only doesn't work - for (int i = 0; i < 9; ++i) { - craftingInv.setStack(i, damagedPickaxe); - } + List damagedPickaxes = Collections.nCopies(9, damagedPickaxe); - if (recipe.matches(craftingInv, context.getWorld())) { + if (recipe.matches(CraftingRecipeInput.create(3, 3, damagedPickaxes), context.getWorld())) { throw new GameTestException("Recipe should not match with only damaged pickaxes"); } - craftingInv.setStack(1, undamagedPickaxe); + List oneUndamagedPickaxe = new LinkedList<>(damagedPickaxes); + oneUndamagedPickaxe.set(0, undamagedPickaxe); - if (!recipe.matches(craftingInv, context.getWorld())) { + if (!recipe.matches(CraftingRecipeInput.create(3, 3, oneUndamagedPickaxe), context.getWorld())) { throw new GameTestException("Recipe should match with at least one undamaged pickaxe"); } diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/DynamicRegistriesImpl.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/DynamicRegistriesImpl.java index 83db87df03..b4cdc9dfb3 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/DynamicRegistriesImpl.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/DynamicRegistriesImpl.java @@ -59,7 +59,7 @@ public static RegistryLoader.Entry register(RegistryKey(key, codec); + var entry = new RegistryLoader.Entry<>(key, codec, false); DYNAMIC_REGISTRIES.add(entry); FABRIC_DYNAMIC_REGISTRY_KEYS.add(key); return entry; @@ -74,7 +74,7 @@ public static void addSyncedRegistry(RegistryKey> key, RegistryLoader.SYNCED_REGISTRIES = new ArrayList<>(RegistryLoader.SYNCED_REGISTRIES); } - RegistryLoader.SYNCED_REGISTRIES.add(new RegistryLoader.Entry<>(key, networkCodec)); + RegistryLoader.SYNCED_REGISTRIES.add(new RegistryLoader.Entry<>(key, networkCodec, false)); if (!(SerializableRegistries.SYNCED_REGISTRIES instanceof HashSet>>)) { SerializableRegistries.SYNCED_REGISTRIES = new HashSet<>(SerializableRegistries.SYNCED_REGISTRIES); diff --git a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java index 59f89d9def..ef20ab4160 100644 --- a/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java +++ b/fabric-registry-sync-v0/src/main/java/net/fabricmc/fabric/impl/registry/sync/FabricRegistryInit.java @@ -53,10 +53,6 @@ public void onInitialize() { RegistryAttributeHolder.get(Registries.BLOCK) .addAttribute(RegistryAttribute.SYNCED); - // Synced in EnchantmentScreenHandler - RegistryAttributeHolder.get(Registries.ENCHANTMENT) - .addAttribute(RegistryAttribute.SYNCED); - // Synced in EntitySpawnS2CPacket and RegistryTagManager RegistryAttributeHolder.get(Registries.ENTITY_TYPE) .addAttribute(RegistryAttribute.SYNCED); @@ -101,10 +97,6 @@ public void onInitialize() { RegistryAttributeHolder.get(Registries.BLOCK_ENTITY_TYPE) .addAttribute(RegistryAttribute.SYNCED); - // Synced in PaintingSpawnS2CPacket - RegistryAttributeHolder.get(Registries.PAINTING_VARIANT) - .addAttribute(RegistryAttribute.SYNCED); - // Synced via PacketCodecs.registry RegistryAttributeHolder.get(Registries.CUSTOM_STAT) .addAttribute(RegistryAttribute.SYNCED); @@ -137,10 +129,6 @@ public void onInitialize() { RegistryAttributeHolder.get(Registries.FROG_VARIANT) .addAttribute(RegistryAttribute.SYNCED); - // Uses a data tracker (and thus, raw IDs) to sync painting entities to the client - RegistryAttributeHolder.get(Registries.PAINTING_VARIANT) - .addAttribute(RegistryAttribute.SYNCED); - // Uses the raw ID when syncing the command tree to the client RegistryAttributeHolder.get(Registries.COMMAND_ARGUMENT_TYPE) .addAttribute(RegistryAttribute.SYNCED); diff --git a/fabric-registry-sync-v0/src/main/resources/fabric.mod.json b/fabric-registry-sync-v0/src/main/resources/fabric.mod.json index 883896573b..e2a8e30533 100644 --- a/fabric-registry-sync-v0/src/main/resources/fabric.mod.json +++ b/fabric-registry-sync-v0/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-networking-api-v1": "*" }, diff --git a/fabric-renderer-api-v1/src/client/resources/fabric.mod.json b/fabric-renderer-api-v1/src/client/resources/fabric.mod.json index 9b0548f112..7b1f0db72e 100644 --- a/fabric-renderer-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-renderer-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.15-alpha.19.39.a", "fabric-api-base": "*" }, diff --git a/fabric-renderer-indigo/src/client/resources/fabric.mod.json b/fabric-renderer-indigo/src/client/resources/fabric.mod.json index 3c3411aaa7..ea9e5f1a4d 100644 --- a/fabric-renderer-indigo/src/client/resources/fabric.mod.json +++ b/fabric-renderer-indigo/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.15-alpha.19.39.a", "fabric-api-base": "*", "fabric-renderer-api-v1": "*" diff --git a/fabric-rendering-fluids-v1/src/main/resources/fabric.mod.json b/fabric-rendering-fluids-v1/src/main/resources/fabric.mod.json index f71c00cd78..33b4d8ab0d 100644 --- a/fabric-rendering-fluids-v1/src/main/resources/fabric.mod.json +++ b/fabric-rendering-fluids-v1/src/main/resources/fabric.mod.json @@ -15,7 +15,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Hooks for registering fluid renders.", diff --git a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/InGameHudMixin.java b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/InGameHudMixin.java index 4138889d62..48f53a2116 100644 --- a/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/InGameHudMixin.java +++ b/fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering/InGameHudMixin.java @@ -29,7 +29,7 @@ @Mixin(InGameHud.class) public class InGameHudMixin { - @Inject(method = "render", at = @At(value = "TAIL"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/PlayerListHud;render(Lnet/minecraft/client/gui/DrawContext;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreboardObjective;)V"))) + @Inject(method = "render", at = @At(value = "TAIL"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/LayeredDrawer;render(Lnet/minecraft/client/gui/DrawContext;F)V"))) public void render(DrawContext drawContext, float tickDelta, CallbackInfo callbackInfo) { HudRenderCallback.EVENT.invoker().onHudRender(drawContext, tickDelta); } diff --git a/fabric-rendering-v1/src/client/resources/fabric.mod.json b/fabric-rendering-v1/src/client/resources/fabric.mod.json index c9e574ade3..d3224ffb9a 100644 --- a/fabric-rendering-v1/src/client/resources/fabric.mod.json +++ b/fabric-rendering-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Hooks and registries for rendering-related things.", diff --git a/fabric-resource-conditions-api-v1/src/main/resources/fabric.mod.json b/fabric-resource-conditions-api-v1/src/main/resources/fabric.mod.json index 329970872a..8214e7048f 100644 --- a/fabric-resource-conditions-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-resource-conditions-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Allows conditionally loading resources.", "entrypoints": { diff --git a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/SimpleResourceReloadMixin.java b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/SimpleResourceReloadMixin.java index e3d67f9c4b..2c67f46c9b 100644 --- a/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/SimpleResourceReloadMixin.java +++ b/fabric-resource-loader-v0/src/main/java/net/fabricmc/fabric/mixin/resource/loader/SimpleResourceReloadMixin.java @@ -58,7 +58,7 @@ private static List sortSimple(List reloader return sorted; } - @Redirect(method = "start", at = @At(value = "NEW", target = "Lnet/minecraft/resource/ProfiledResourceReload;")) + @Redirect(method = "start", at = @At(value = "NEW", target = "(Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lnet/minecraft/resource/ProfiledResourceReload;")) private static ProfiledResourceReload sortProfiled(ResourceManager manager, List reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture initialStage) { List sorted = ResourceManagerHelperImpl.sort(fabric_resourceType.get(), reloaders); fabric_resourceType.set(null); diff --git a/fabric-resource-loader-v0/src/main/resources/fabric.mod.json b/fabric-resource-loader-v0/src/main/resources/fabric.mod.json index 47e88c1259..68eb8e52da 100644 --- a/fabric-resource-loader-v0/src/main/resources/fabric.mod.json +++ b/fabric-resource-loader-v0/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Asset and data resource loading.", "mixins": [ diff --git a/fabric-screen-api-v1/src/client/resources/fabric.mod.json b/fabric-screen-api-v1/src/client/resources/fabric.mod.json index e68c75d004..11a8428560 100644 --- a/fabric-screen-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-screen-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*" }, "description": "Adds screen related hooks.", diff --git a/fabric-screen-handler-api-v1/src/main/resources/fabric.mod.json b/fabric-screen-handler-api-v1/src/main/resources/fabric.mod.json index 434b2a7839..0d1a8d320f 100644 --- a/fabric-screen-handler-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-screen-handler-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-base": "*", "fabric-networking-api-v1": "*" }, diff --git a/fabric-sound-api-v1/src/client/resources/fabric.mod.json b/fabric-sound-api-v1/src/client/resources/fabric.mod.json index f0d87b6d1a..ca0d13a734 100644 --- a/fabric-sound-api-v1/src/client/resources/fabric.mod.json +++ b/fabric-sound-api-v1/src/client/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "minecraft": ">=1.19.2" }, "description": "Hooks for modifying Minecraft's sound system.", diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java index 4a0a9b5d66..6a6f49009a 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/api/transfer/v1/storage/base/ResourceAmount.java @@ -20,5 +20,5 @@ * An immutable object storing both a resource and an amount, provided for convenience. * @param The type of the stored resource. */ -public record ResourceAmount (T resource, long amount) { +public record ResourceAmount(T resource, long amount) { } diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/InventorySlotWrapper.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/InventorySlotWrapper.java index 9dddfa9b3c..873b615914 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/InventorySlotWrapper.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/InventorySlotWrapper.java @@ -24,7 +24,7 @@ import net.minecraft.block.entity.ChestBlockEntity; import net.minecraft.block.entity.ShulkerBoxBlockEntity; import net.minecraft.block.enums.ChestType; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.math.BlockPos; @@ -159,7 +159,7 @@ protected void onFinalCommit() { // Components have changed, we need to copy the stack. if (!Objects.equals(original.getComponentChanges(), currentStack.getComponentChanges())) { // Remove all the existing components and copy the new ones on top. - for (DataComponentType type : original.getComponents().getTypes()) { + for (ComponentType type : original.getComponents().getTypes()) { original.set(type, null); } diff --git a/fabric-transfer-api-v1/src/main/resources/fabric.mod.json b/fabric-transfer-api-v1/src/main/resources/fabric.mod.json index 3df9aab8f7..0370b2cfd5 100644 --- a/fabric-transfer-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-transfer-api-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "fabric-api-lookup-api-v1": "*", "fabric-rendering-fluids-v1": "*" }, diff --git a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/FluidTests.java b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/FluidTests.java index c02fc3f319..49e1c7832d 100644 --- a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/FluidTests.java +++ b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/FluidTests.java @@ -24,7 +24,7 @@ import org.junit.jupiter.api.Test; import net.minecraft.component.ComponentChanges; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.fluid.Fluids; import net.minecraft.network.PacketByteBuf; import net.minecraft.network.RegistryByteBuf; @@ -44,7 +44,7 @@ class FluidTests extends AbstractTransferApiTest { private static FluidVariant TAGGED_WATER, TAGGED_WATER_2, WATER, LAVA; private static int finalCommitCount = 0; - public static DataComponentType TEST; + public static ComponentType TEST; private static SingleSlotStorage createWaterStorage() { return new SingleVariantStorage<>() { @Override @@ -81,7 +81,7 @@ static void beforeAll() { WATER = FluidVariant.of(Fluids.WATER); LAVA = FluidVariant.of(Fluids.LAVA); TEST = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "test"), - DataComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); + ComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); } @Test diff --git a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/ItemTests.java b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/ItemTests.java index 9cbb2e2b67..ebbc73cd4a 100644 --- a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/ItemTests.java +++ b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/ItemTests.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; import net.minecraft.component.ComponentChanges; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.component.DataComponentTypes; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.SidedInventory; @@ -57,13 +57,13 @@ * Tests for the item transfer APIs. */ class ItemTests extends AbstractTransferApiTest { - public static DataComponentType ENERGY; + public static ComponentType ENERGY; @BeforeAll static void beforeAll() { bootstrap(); ENERGY = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "energy"), - DataComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); + ComponentType.builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build()); } @Test diff --git a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/SingleVariantItemStorageTests.java b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/SingleVariantItemStorageTests.java index 00bad3546d..d79c03bf73 100644 --- a/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/SingleVariantItemStorageTests.java +++ b/fabric-transfer-api-v1/src/test/java/net/fabricmc/fabric/test/transfer/unittests/SingleVariantItemStorageTests.java @@ -27,7 +27,7 @@ import org.junit.jupiter.api.Test; import net.minecraft.component.ComponentChanges; -import net.minecraft.component.DataComponentType; +import net.minecraft.component.ComponentType; import net.minecraft.component.DataComponentTypes; import net.minecraft.fluid.Fluids; import net.minecraft.inventory.Inventory; @@ -57,7 +57,7 @@ public class SingleVariantItemStorageTests extends AbstractTransferApiTest { private static FluidVariant LAVA; - public static DataComponentType FLUID; + public static ComponentType FLUID; @BeforeAll static void beforeAll() { @@ -66,7 +66,7 @@ static void beforeAll() { LAVA = FluidVariant.of(Fluids.LAVA); FLUID = Registry.register( Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "fluid"), - DataComponentType.builder().codec(FluidData.CODEC).packetCodec(FluidData.PACKET_CODEC).build()); + ComponentType.builder().codec(FluidData.CODEC).packetCodec(FluidData.PACKET_CODEC).build()); } @Test diff --git a/fabric-transitive-access-wideners-v1/src/main/resources/fabric.mod.json b/fabric-transitive-access-wideners-v1/src/main/resources/fabric.mod.json index 53eb08a437..ed9fc503df 100644 --- a/fabric-transitive-access-wideners-v1/src/main/resources/fabric.mod.json +++ b/fabric-transitive-access-wideners-v1/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6" + "fabricloader": ">=0.15.11" }, "description": "Contains transitive access wideners that provide access to otherwise inaccessible Minecraft code.", "accessWidener": "fabric-transitive-access-wideners-v1.accesswidener", diff --git a/gradle.properties b/gradle.properties index b73c01bfc8..0e8e2a1b86 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,62 +2,62 @@ org.gradle.jvmargs=-Xmx2560M org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true -version=0.97.8 -minecraft_version=1.20.6-rc1 -yarn_version=+build.1 -loader_version=0.15.6 +version=0.97.9 +minecraft_version=24w18a +yarn_version=+build.2 +loader_version=0.15.11 installer_version=1.0.1 prerelease=true -curseforge_minecraft_version=1.20.5-Snapshot +curseforge_minecraft_version=1.21-Snapshot # Do not manually update, use the bumpversions task: -fabric-api-base-version=0.4.40 -fabric-api-lookup-api-v1-version=1.6.59 -fabric-biome-api-v1-version=13.0.25 -fabric-block-api-v1-version=1.0.20 -fabric-block-view-api-v2-version=1.0.8 -fabric-blockrenderlayer-v1-version=1.1.50 -fabric-command-api-v1-version=1.2.45 -fabric-command-api-v2-version=2.2.24 -fabric-commands-v0-version=0.2.62 -fabric-content-registries-v0-version=8.0.4 -fabric-crash-report-info-v1-version=0.2.27 -fabric-data-attachment-api-v1-version=1.1.15 -fabric-data-generation-api-v1-version=19.0.6 -fabric-dimensions-v1-version=2.1.68 -fabric-entity-events-v1-version=1.6.8 -fabric-events-interaction-v0-version=0.7.6 -fabric-game-rule-api-v1-version=1.0.50 -fabric-gametest-api-v1-version=1.3.16 -fabric-item-api-v1-version=8.1.1 -fabric-item-group-api-v1-version=4.0.38 -fabric-key-binding-api-v1-version=1.0.45 -fabric-keybindings-v0-version=0.2.43 -fabric-lifecycle-events-v1-version=2.3.4 -fabric-loot-api-v2-version=3.0.4 -fabric-message-api-v1-version=6.0.10 -fabric-model-loading-api-v1-version=1.0.12 -fabric-models-v0-version=0.4.11 -fabric-networking-api-v1-version=4.0.8 -fabric-object-builder-api-v1-version=15.1.3 -fabric-particles-v1-version=4.0.0 -fabric-recipe-api-v1-version=5.0.3 -fabric-registry-sync-v0-version=5.0.15 -fabric-renderer-api-v1-version=3.2.12 -fabric-renderer-indigo-version=1.5.12 -fabric-renderer-registries-v1-version=3.2.61 -fabric-rendering-data-attachment-v1-version=0.3.46 -fabric-rendering-fluids-v1-version=3.1.3 -fabric-rendering-v0-version=1.1.64 -fabric-rendering-v1-version=4.2.4 -fabric-resource-conditions-api-v1-version=4.0.1 -fabric-resource-loader-v0-version=1.0.5 -fabric-screen-api-v1-version=2.0.21 -fabric-screen-handler-api-v1-version=1.3.72 -fabric-sound-api-v1-version=1.0.21 -fabric-transfer-api-v1-version=5.1.6 -fabric-transitive-access-wideners-v1-version=6.0.10 -fabric-convention-tags-v1-version=2.0.3 -fabric-convention-tags-v2-version=2.0.0 -fabric-client-tags-api-v1-version=1.1.12 +fabric-api-base-version=0.4.41 +fabric-api-lookup-api-v1-version=1.6.60 +fabric-biome-api-v1-version=13.0.26 +fabric-block-api-v1-version=1.0.21 +fabric-block-view-api-v2-version=1.0.9 +fabric-blockrenderlayer-v1-version=1.1.51 +fabric-command-api-v1-version=1.2.46 +fabric-command-api-v2-version=2.2.25 +fabric-commands-v0-version=0.2.63 +fabric-content-registries-v0-version=8.0.5 +fabric-crash-report-info-v1-version=0.2.28 +fabric-data-attachment-api-v1-version=1.1.16 +fabric-data-generation-api-v1-version=20.0.0 +fabric-dimensions-v1-version=2.1.69 +fabric-entity-events-v1-version=1.6.9 +fabric-events-interaction-v0-version=0.7.7 +fabric-game-rule-api-v1-version=1.0.51 +fabric-gametest-api-v1-version=1.3.17 +fabric-item-api-v1-version=9.0.0 +fabric-item-group-api-v1-version=4.0.39 +fabric-key-binding-api-v1-version=1.0.46 +fabric-keybindings-v0-version=0.2.44 +fabric-lifecycle-events-v1-version=2.3.5 +fabric-loot-api-v2-version=3.0.5 +fabric-message-api-v1-version=6.0.11 +fabric-model-loading-api-v1-version=1.0.13 +fabric-models-v0-version=0.4.12 +fabric-networking-api-v1-version=4.0.9 +fabric-object-builder-api-v1-version=15.1.4 +fabric-particles-v1-version=4.0.1 +fabric-recipe-api-v1-version=5.0.4 +fabric-registry-sync-v0-version=5.0.16 +fabric-renderer-api-v1-version=3.2.13 +fabric-renderer-indigo-version=1.5.13 +fabric-renderer-registries-v1-version=3.2.62 +fabric-rendering-data-attachment-v1-version=0.3.47 +fabric-rendering-fluids-v1-version=3.1.4 +fabric-rendering-v0-version=1.1.65 +fabric-rendering-v1-version=4.2.5 +fabric-resource-conditions-api-v1-version=4.0.2 +fabric-resource-loader-v0-version=1.0.6 +fabric-screen-api-v1-version=2.0.22 +fabric-screen-handler-api-v1-version=1.3.73 +fabric-sound-api-v1-version=1.0.22 +fabric-transfer-api-v1-version=5.1.7 +fabric-transitive-access-wideners-v1-version=6.0.11 +fabric-convention-tags-v1-version=2.0.4 +fabric-convention-tags-v2-version=2.0.1 +fabric-client-tags-api-v1-version=1.1.13 diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9cfb266559..6b66d0cbe7 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,9 +19,9 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.15.6", + "fabricloader": ">=0.15.11", "java": ">=21", - "minecraft": ">=1.20.5- <1.20.7-" + "minecraft": ">=1.21- <1.21.1-" }, "description": "Core API module providing key hooks and intercompatibility features." }