From 59d8e4589af3232cdc3ad651bc1aec5d426fafac Mon Sep 17 00:00:00 2001 From: trinsdar <30245301+Trinsdar@users.noreply.github.com> Date: Thu, 12 Dec 2024 20:43:28 -0500 Subject: [PATCH] fixed possible build error --- fabric/build.gradle | 23 +++++++++++++++++-- .../resources/antimatter.accesswidener | 4 +++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/fabric/build.gradle b/fabric/build.gradle index 9e9db1984..e59d7c59c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -23,6 +23,14 @@ loom { } } +sourceSets { + main { + resources { + srcDir generatedResources + } + } +} + dependencies{ minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings loom.layered() { @@ -88,10 +96,18 @@ dependencies{ //include("org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin.coreLibrariesVersion}") } +// The AW file is needed in :fabric project resources when the game is run. +task copyAccessWidener(type: Copy) { + from accessWidenerFile + into generatedResources +} processResources { - from project(":antimatter-common").sourceSets.main.resources + dependsOn copyAccessWidener + from(project(":antimatter-common").sourceSets.main.resources){ + exclude("antimatter.accesswidener") + } def toReplace = [ "version" : project.mod_version ] @@ -106,7 +122,10 @@ tasks.named('compileJava', JavaCompile) { } sourcesJar { - from(project(':antimatter-common').sourceSets.main.allSource) + mustRunAfter copyAccessWidener + from(project(':antimatter-common').sourceSets.main.allSource){ + exclude("antimatter.accesswidener") + } } tasks.create("platformJar", ExpectPlatformJar){ diff --git a/fabric/src/generated/resources/antimatter.accesswidener b/fabric/src/generated/resources/antimatter.accesswidener index f44aabe29..78f081712 100644 --- a/fabric/src/generated/resources/antimatter.accesswidener +++ b/fabric/src/generated/resources/antimatter.accesswidener @@ -17,4 +17,6 @@ accessible method net/minecraft/world/item/crafting/ShapedRecipe patternFromJson accessible method net/minecraft/world/item/crafting/ShapedRecipe keyFromJson (Lcom/google/gson/JsonObject;)Ljava/util/Map; accessible method net/minecraft/world/item/crafting/ShapedRecipe matches (Lnet/minecraft/world/inventory/CraftingContainer;IIZ)Z accessible method net/minecraft/world/item/context/UseOnContext (Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/phys/BlockHitResult;)V -accessible method net/minecraft/world/item/context/UseOnContext getHitResult ()Lnet/minecraft/world/phys/BlockHitResult; \ No newline at end of file +accessible method net/minecraft/world/item/context/UseOnContext getHitResult ()Lnet/minecraft/world/phys/BlockHitResult; +accessible class net/minecraft/client/gui/screens/MenuScreens$ScreenConstructor +accessible class net/minecraft/world/level/block/entity/BlockEntityType$BlockEntitySupplier \ No newline at end of file