From 7a1b507b08fe3b9050dd955072ddbd6296561b63 Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 14 Jan 2023 11:28:25 +0000 Subject: [PATCH 1/4] Update buildscript --- build.gradle | 38 ++++++++++++++++++++++++++++---------- gradlew | 0 2 files changed, 28 insertions(+), 10 deletions(-) mode change 100644 => 100755 gradlew diff --git a/build.gradle b/build.gradle index 89350b8a..2dc32c9f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1669411416 +//version: 1673027205 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -31,7 +31,7 @@ buildscript { url 'https://maven.minecraftforge.net' } maven { - // GTNH ForgeGradle Fork + // GTNH ForgeGradle and ASM Fork name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } @@ -45,7 +45,9 @@ buildscript { } } dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.11' + //Overwrite the current ASM version to fix shading newer than java 8 applicatations. + classpath 'org.ow2.asm:asm-debug-all-custom:5.0.3' + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2.13' } } plugins { @@ -278,7 +280,9 @@ minecraft { runDir = 'run' if (replaceGradleTokenInFile) { - replaceIn replaceGradleTokenInFile + for (f in replaceGradleTokenInFile.split(',')) { + replaceIn f + } if (gradleTokenModId) { replace gradleTokenModId, modId } @@ -315,9 +319,13 @@ if (file('addon.gradle').exists()) { apply from: 'repositories.gradle' configurations { - implementation.extendsFrom(shadowImplementation) // TODO: remove after all uses are refactored - implementation.extendsFrom(shadowCompile) - implementation.extendsFrom(shadeCompile) + // TODO: remove Compile after all uses are refactored to Implementation + for (config in [shadowImplementation, shadowCompile, shadeCompile]) { + compileClasspath.extendsFrom(config) + runtimeClasspath.extendsFrom(config) + testCompileClasspath.extendsFrom(config) + testRuntimeClasspath.extendsFrom(config) + } } repositories { @@ -330,6 +338,12 @@ repositories { name = "GTNH Maven" url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" } + if (usesMixinDebug.toBoolean()) { + maven { + name = "Fabric Maven" + url = "https://maven.fabricmc.net/" + } + } } } @@ -338,10 +352,14 @@ dependencies { annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3') annotationProcessor('com.google.guava:guava:24.1.1-jre') annotationProcessor('com.google.code.gson:gson:2.8.6') - annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.1:processor') + annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.3:processor') + if (usesMixinDebug.toBoolean()) { + runtimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + testRuntimeClasspath('org.jetbrains:intellij-fernflower:1.2.1.16') + } } if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) { - compile('com.gtnewhorizon:gtnhmixins:2.1.1') + compile('com.gtnewhorizon:gtnhmixins:2.1.3') } } @@ -694,7 +712,7 @@ if (modrinthProjectId.size() != 0 && System.getenv("MODRINTH_TOKEN") != null) { } } if (usesMixins.toBoolean()) { - addModrinthDep("required", "version", "gtnhmixins") + addModrinthDep("required", "project", "gtnhmixins") } tasks.modrinth.dependsOn(build) tasks.publish.dependsOn(tasks.modrinth) diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From f203c2455145a77442ff802bbed30ef48aab526d Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 14 Jan 2023 12:48:06 +0000 Subject: [PATCH 2/4] Update dependencies --- dependencies.gradle | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 9ca480b7..08830c4a 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,28 +1,27 @@ // Add your dependencies here dependencies { - compile('com.github.GTNewHorizons:NotEnoughItems:2.3.10-GTNH:dev') + compile('com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev') compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-137-GTNH:dev') compile('curse.maven:cofh-core-69162:2388751') compile('com.github.GTNewHorizons:waila:1.5.22:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false } compileOnly("com.github.GTNewHorizons:WirelessCraftingTerminal:1.8.9.2:dev") - compileOnly('com.github.GTNewHorizons:ForestryMC:4.4.7:dev') - compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.48:dev') + compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.6:dev') + compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.49:dev') compileOnly('com.github.GTNewHorizons:EnderCore:0.2.11:dev') - compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.41:dev') - compileOnly('com.github.GTNewHorizons:StructureLib:1.0.15:dev') + compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.216:dev') + compileOnly('com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev') compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') - compileOnly('com.github.GTNewHorizons:AppleCore:3.1.9:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.27:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:AppleCore:3.2.5:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.28:dev') { transitive = false } compileOnly('com.gregoriust.gregtech:gregtech_1.7.10:6.14.23:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:OpenComputers:1.7.5.23-GTNH:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.3.19-GTNH:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.29:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.49:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.5-GTNH:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:ThaumicEnergistics:1.3.27-GTNH:dev') { transitive = false } + compileOnly('com.github.GTNewHorizons:GTplusplus:1.7.191:dev') { transitive = false } - compileOnly('com.github.GTNewHorizons:KekzTech:0.6.22:dev') + compileOnly('com.github.GTNewHorizons:KekzTech:0.6.25:dev') runtime('com.github.GTNewHorizons:Baubles:1.0.1.14:dev') } From 18630c9618f4b60b2572d17ca036c699f5ab827a Mon Sep 17 00:00:00 2001 From: Raven Szewczyk Date: Sat, 14 Jan 2023 18:04:23 +0000 Subject: [PATCH 3/4] Add crafting calculator v2 compat for newer AE2-GTNH versions --- dependencies.gradle | 2 +- .../java/com/glodblock/github/FluidCraft.java | 11 ++++++++++ .../loader/CalculatorV2PluginLoader.java | 21 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/glodblock/github/loader/CalculatorV2PluginLoader.java diff --git a/dependencies.gradle b/dependencies.gradle index 08830c4a..24a077a6 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { compile('com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev') - compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-137-GTNH:dev') + compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-137-GTNH-10-g625c054:dev') compile('curse.maven:cofh-core-69162:2388751') compile('com.github.GTNewHorizons:waila:1.5.22:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false } diff --git a/src/main/java/com/glodblock/github/FluidCraft.java b/src/main/java/com/glodblock/github/FluidCraft.java index 95afb9e1..e04df2d7 100644 --- a/src/main/java/com/glodblock/github/FluidCraft.java +++ b/src/main/java/com/glodblock/github/FluidCraft.java @@ -7,6 +7,7 @@ import com.glodblock.github.common.storage.FluidCellHandler; import com.glodblock.github.crossmod.opencomputers.OCDriverInit; import com.glodblock.github.crossmod.waila.WailaInit; import com.glodblock.github.inventory.InventoryHandler; +import com.glodblock.github.loader.CalculatorV2PluginLoader; import com.glodblock.github.loader.ChannelLoader; import com.glodblock.github.loader.ItemAndBlockHolder; import com.glodblock.github.loader.RecipeLoader; @@ -90,6 +91,16 @@ public class FluidCraft { Upgrades.CRAFTING.registerItem(new ItemStack(ItemAndBlockHolder.FLUID_EXPORT_BUS), 1); } + try { + Class calculatorV2 = Class.forName("appeng.crafting.v2.CraftingCalculations"); + if (calculatorV2 != null) { + // Only run this if GTNH AE2 is installed + CalculatorV2PluginLoader.installCalculatorV2Plugins(); + } + } catch (ClassNotFoundException e) { + // no-op + } + proxy.postInit(event); } diff --git a/src/main/java/com/glodblock/github/loader/CalculatorV2PluginLoader.java b/src/main/java/com/glodblock/github/loader/CalculatorV2PluginLoader.java new file mode 100644 index 00000000..b388512c --- /dev/null +++ b/src/main/java/com/glodblock/github/loader/CalculatorV2PluginLoader.java @@ -0,0 +1,21 @@ +package com.glodblock.github.loader; + +import appeng.api.storage.data.IAEItemStack; +import appeng.crafting.v2.CraftingCalculations; +import appeng.crafting.v2.CraftingRequest; +import appeng.util.Platform; +import com.glodblock.github.common.item.ItemFluidDrop; + +public class CalculatorV2PluginLoader { + private static long adjustByteCost(CraftingRequest request, Long originalAmount) { + if (request.stack.getItem() instanceof ItemFluidDrop) { + return Platform.ceilDiv(originalAmount, 1000L); + } else { + return originalAmount; + } + } + + public static void installCalculatorV2Plugins() { + CraftingCalculations.registerByteAmountAdjuster(CalculatorV2PluginLoader::adjustByteCost, IAEItemStack.class); + } +} From 2679df71c45b0982af287b35ea7d6bae11b244c2 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Sun, 15 Jan 2023 12:33:09 +0100 Subject: [PATCH 4/4] Update dependencies.gradle --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 24a077a6..16b2345e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -2,7 +2,7 @@ dependencies { compile('com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev') - compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-137-GTNH-10-g625c054:dev') + compile('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-138-GTNH:dev') compile('curse.maven:cofh-core-69162:2388751') compile('com.github.GTNewHorizons:waila:1.5.22:dev') compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.25:dev') { transitive = false }