Skip to content

Commit 1ec9d59

Browse files
Fix items not being added in the pack (#20)
* Move isGTNH initialization * update bs+sa --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
1 parent ec0b739 commit 1ec9d59

File tree

717 files changed

+2926
-3175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

717 files changed

+2926
-3175
lines changed

build.gradle

+45-119
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,30 @@
1-
//version: 1679836390
1+
//version: 1682616243
22
/*
33
DO NOT CHANGE THIS FILE!
44
Also, you may replace this file at any time if there is an update available.
55
Please check https://github.com/GTNewHorizons/ExampleMod1.7.10/blob/master/build.gradle for updates.
66
*/
77

88

9-
import com.diffplug.blowdryer.Blowdryer
10-
import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation
119
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
1210
import com.gtnewhorizons.retrofuturagradle.ObfuscationAttribute
1311
import com.gtnewhorizons.retrofuturagradle.mcp.ReobfuscatedJar
1412
import com.gtnewhorizons.retrofuturagradle.minecraft.RunMinecraftTask
13+
import com.gtnewhorizons.retrofuturagradle.util.Distribution
1514
import com.matthewprenger.cursegradle.CurseArtifact
1615
import com.matthewprenger.cursegradle.CurseRelation
1716
import com.modrinth.minotaur.dependencies.ModDependency
1817
import com.modrinth.minotaur.dependencies.VersionDependency
19-
import cpw.mods.fml.relauncher.Side
20-
import org.gradle.api.tasks.options.Option;
2118
import org.gradle.internal.logging.text.StyledTextOutput.Style
2219
import org.gradle.internal.logging.text.StyledTextOutputFactory
2320
import org.gradle.internal.xml.XmlTransformer
24-
import org.jetbrains.gradle.ext.*
21+
import org.jetbrains.gradle.ext.Application
22+
import org.jetbrains.gradle.ext.Gradle
2523

24+
import javax.inject.Inject
2625
import java.nio.file.Files
2726
import java.nio.file.Paths
2827
import java.util.concurrent.TimeUnit
29-
import java.util.zip.ZipEntry
30-
import java.util.zip.ZipOutputStream
31-
import javax.inject.Inject
3228

3329
buildscript {
3430
repositories {
@@ -66,21 +62,22 @@ plugins {
6662
id 'org.jetbrains.kotlin.kapt' version '1.8.0' apply false
6763
id 'com.google.devtools.ksp' version '1.8.0-1.0.9' apply false
6864
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
69-
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
70-
id 'com.palantir.git-version' version '0.13.0' apply false // 0.13.0 is the last jvm8 supporting version
71-
id 'de.undercouch.download' version '5.3.0'
65+
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
66+
id 'com.palantir.git-version' version '3.0.0' apply false
67+
id 'de.undercouch.download' version '5.4.0'
7268
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
73-
id 'com.diffplug.spotless' version '6.7.2' apply false
69+
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
7470
id 'com.modrinth.minotaur' version '2.+' apply false
7571
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
76-
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3'
72+
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7'
7773
}
7874
boolean settingsupdated = verifySettingsGradle()
7975
settingsupdated = verifyGitAttributes() || settingsupdated
8076
if (settingsupdated)
8177
throw new GradleException("Settings has been updated, please re-run task.")
8278

83-
if (project.file('.git/HEAD').isFile()) {
79+
// In submodules, .git is a file pointing to the real git dir
80+
if (project.file('.git/HEAD').isFile() || project.file('.git').isFile()) {
8481
apply plugin: 'com.palantir.git-version'
8582
}
8683

@@ -132,7 +129,7 @@ propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new
132129
// this is meant to be set using the user wide property file. by default we do nothing.
133130
propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea"
134131

135-
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
132+
project.extensions.add(com.diffplug.blowdryer.Blowdryer, "Blowdryer", com.diffplug.blowdryer.Blowdryer) // Make blowdryer available in "apply from:" scripts
136133
if (!disableSpotless) {
137134
apply plugin: 'com.diffplug.spotless'
138135
apply from: Blowdryer.file('spotless.gradle')
@@ -201,6 +198,14 @@ configurations {
201198
canBeConsumed = false
202199
canBeResolved = false
203200
}
201+
202+
create("devOnlyNonPublishable") {
203+
description = "Runtime and compiletime dependencies that are not published alongside the jar (compileOnly + runtimeOnlyNonPublishable)"
204+
canBeConsumed = false
205+
canBeResolved = false
206+
}
207+
compileOnly.extendsFrom(devOnlyNonPublishable)
208+
runtimeOnlyNonPublishable.extendsFrom(devOnlyNonPublishable)
204209
}
205210

206211
if (enableModernJavaSyntax.toBoolean()) {
@@ -399,14 +404,12 @@ minecraft {
399404

400405
username = developmentEnvironmentUserName.toString()
401406

402-
lwjgl3Version = "3.3.2-SNAPSHOT"
407+
lwjgl3Version = "3.3.2"
403408

404409
// Enable assertions in the current mod
405410
extraRunJvmArguments.add("-ea:${modGroup}")
406411

407412
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
408-
extraTweakClasses.add("org.spongepowered.asm.launch.MixinTweaker")
409-
410413
if (usesMixinDebug.toBoolean()) {
411414
extraRunJvmArguments.addAll([
412415
"-Dmixin.debug.countInjections=true",
@@ -561,8 +564,9 @@ repositories {
561564

562565
def mixinProviderGroup = "io.github.legacymoddingmc"
563566
def mixinProviderModule = "unimixins"
564-
def mixinProviderVersion = "0.1.5"
565-
def mixinProviderSpec = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
567+
def mixinProviderVersion = "0.1.6"
568+
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
569+
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
566570

567571
dependencies {
568572
if (usesMixins.toBoolean()) {
@@ -574,8 +578,10 @@ dependencies {
574578
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
575579
}
576580
}
577-
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
581+
if (usesMixins.toBoolean()) {
578582
implementation(mixinProviderSpec)
583+
} else if (forceEnableMixins.toBoolean()) {
584+
runtimeOnlyNonPublishable(mixinProviderSpec)
579585
}
580586
}
581587

@@ -591,10 +597,11 @@ pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
591597
// https://docs.gradle.org/8.0.2/userguide/resolution_rules.html#sec:substitution_with_classifier
592598
configurations.all {
593599
resolutionStrategy.dependencySubstitution {
594-
substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpec) withoutClassifier() because("Unimixins replaces other mixin mods")
595-
substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpec) withoutClassifier() because("Unimixins replaces other mixin mods")
596-
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpec) withoutClassifier() because("Unimixins replaces other mixin mods")
597-
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpec) withoutClassifier() because("Unimixins replaces other mixin mods")
600+
substitute module('com.gtnewhorizon:gtnhmixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
601+
substitute module('com.github.GTNewHorizons:Mixingasm') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
602+
substitute module('com.github.GTNewHorizons:SpongePoweredMixin') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
603+
substitute module('com.github.GTNewHorizons:SpongeMixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Unimixins replaces other mixin mods")
604+
substitute module('io.github.legacymoddingmc:unimixins') using module(mixinProviderSpecNoClassifer) withClassifier("dev") because("Our previous unimixins upload was missing the dev classifier")
598605
}
599606
}
600607

@@ -711,13 +718,13 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
711718
}
712719

713720
dependencies {
714-
def lwjgl3ifyVersion = '1.3.3'
721+
def lwjgl3ifyVersion = '1.3.5'
715722
def asmVersion = '9.4'
716723
if (modId != 'lwjgl3ify') {
717724
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
718725
}
719726
if (modId != 'hodgepodge') {
720-
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.4')
727+
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8')
721728
}
722729

723730
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -791,7 +798,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
791798
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
792799

793800
@Inject
794-
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
801+
public RunHotswappableMinecraftTask(Distribution side, String superTask, org.gradle.api.invocation.Gradle gradle) {
795802
super(side, gradle)
796803

797804
this.lwjglVersion = 3
@@ -800,7 +807,7 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
800807
this.extraJvmArgs.addAll(project.provider(() -> enableHotswap ? project.hotswapJvmArgs : []))
801808

802809
this.classpath(project.java17PatchDependenciesCfg)
803-
if (side == Side.CLIENT) {
810+
if (side == Distribution.CLIENT) {
804811
this.classpath(project.minecraftTasks.lwjgl3Configuration)
805812
}
806813
// Use a raw provider instead of map to not create a dependency on the task
@@ -809,14 +816,10 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
809816
!file.path.contains("2.9.4-nightly-20150209") // Remove lwjgl2
810817
}
811818
this.classpath(project.java17DependenciesCfg)
812-
813-
if (!(project.usesMixins.toBoolean() || project.forceEnableMixins.toBoolean())) {
814-
this.extraArgs.addAll("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker")
815-
}
816819
}
817820
}
818821

819-
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Side.CLIENT, "runClient")
822+
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
820823
runClient17Task.configure {
821824
setup(project)
822825
group = "Modded Minecraft"
@@ -827,7 +830,7 @@ runClient17Task.configure {
827830
userUUID = minecraft.userUUID
828831
}
829832

830-
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
833+
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Distribution.DEDICATED_SERVER, "runServer")
831834
runServer17Task.configure {
832835
setup(project)
833836
group = "Modded Minecraft"
@@ -868,11 +871,6 @@ tasks.named("jar", Jar).configure {
868871
}
869872

870873
if (usesShadowedDependencies.toBoolean()) {
871-
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
872-
target = tasks.shadowJar
873-
prefix = modGroup + ".shadow"
874-
enabled = relocateShadowedDependencies.toBoolean()
875-
}
876874
tasks.named("shadowJar", ShadowJar).configure {
877875
manifest {
878876
attributes(getManifestAttributes())
@@ -888,7 +886,8 @@ if (usesShadowedDependencies.toBoolean()) {
888886
]
889887
archiveClassifier.set('dev')
890888
if (relocateShadowedDependencies.toBoolean()) {
891-
dependsOn(relocateShadowJar)
889+
relocationPrefix = modGroup + ".shadow"
890+
enableRelocation = true
892891
}
893892
}
894893
configurations.runtimeElements.outgoing.artifacts.clear()
@@ -1221,7 +1220,7 @@ def addCurseForgeRelation(String type, String name) {
12211220

12221221
// Updating
12231222

1224-
def buildscriptGradleVersion = "8.0.2"
1223+
def buildscriptGradleVersion = "8.1.1"
12251224

12261225
tasks.named('wrapper', Wrapper).configure {
12271226
gradleVersion = buildscriptGradleVersion
@@ -1390,7 +1389,7 @@ static int replaceParams(File file, Map<String, String> params) {
13901389
return 0
13911390
}
13921391

1393-
// Dependency Deobfuscation
1392+
// Dependency Deobfuscation (Deprecated, use the new RFG API documented in dependencies.gradle)
13941393

13951394
def deobf(String sourceURL) {
13961395
try {
@@ -1432,97 +1431,24 @@ def deobfMaven(String repoURL, String mavenDep) {
14321431
}
14331432

14341433
def deobfCurse(String curseDep) {
1435-
try {
1436-
return deobfMaven("https://www.cursemaven.com/", "curse.maven:$curseDep")
1437-
} catch (Exception ignored) {
1438-
out.style(Style.Failure).println("Failed to get $curseDep from cursemaven.")
1439-
}
1434+
return dependencies.rfg.deobf("curse.maven:$curseDep")
14401435
}
14411436

14421437
// The method above is to be preferred. Use this method if the filename is not at the end of the URL.
14431438
def deobf(String sourceURL, String rawFileName) {
14441439
String bon2Version = "2.5.1"
14451440
String fileName = URLDecoder.decode(rawFileName, "UTF-8")
14461441
String cacheDir = "$project.gradle.gradleUserHomeDir/caches"
1447-
String bon2Dir = "$cacheDir/forge_gradle/deobf"
1448-
String bon2File = "$bon2Dir/BON2-${bon2Version}.jar"
14491442
String obfFile = "$cacheDir/modules-2/files-2.1/${fileName}.jar"
1450-
String deobfFile = "$cacheDir/modules-2/files-2.1/${fileName}-deobf.jar"
1451-
1452-
if (file(deobfFile).exists()) {
1453-
return files(deobfFile)
1454-
}
1455-
1456-
String mappingsVer
1457-
String remoteMappings = project.hasProperty('remoteMappings') ? project.remoteMappings : 'https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/'
1458-
if (remoteMappings) {
1459-
String id = "${forgeVersion.split("\\.")[3]}-$minecraftVersion"
1460-
String mappingsZIP = "$cacheDir/forge_gradle/maven_downloader/de/oceanlabs/mcp/mcp_snapshot_nodoc/$id/mcp_snapshot_nodoc-${id}.zip"
1461-
1462-
zipMappings(mappingsZIP, remoteMappings, bon2Dir)
1463-
1464-
mappingsVer = "snapshot_$id"
1465-
} else {
1466-
mappingsVer = "${channel}_$mappingsVersion"
1467-
}
1468-
1469-
download.run {
1470-
src "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/com/github/parker8283/BON2/$bon2Version-CUSTOM/BON2-$bon2Version-CUSTOM-all.jar"
1471-
dest bon2File
1472-
quiet true
1473-
overwrite false
1474-
}
14751443

14761444
download.run {
14771445
src sourceURL
14781446
dest obfFile
14791447
quiet true
14801448
overwrite false
14811449
}
1482-
1483-
exec {
1484-
commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', minecraftVersion, '--mappingsVer', mappingsVer, '--notch'
1485-
workingDir bon2Dir
1486-
standardOutput = new FileOutputStream("${deobfFile}.log")
1487-
}
1488-
1489-
return files(deobfFile)
1450+
return dependencies.rfg.deobf(files(obfFile))
14901451
}
1491-
1492-
def zipMappings(String zipPath, String url, String bon2Dir) {
1493-
File zipFile = new File(zipPath)
1494-
if (zipFile.exists()) {
1495-
return
1496-
}
1497-
1498-
String fieldsCache = "$bon2Dir/data/fields.csv"
1499-
String methodsCache = "$bon2Dir/data/methods.csv"
1500-
1501-
download.run {
1502-
src "${url}fields.csv"
1503-
dest fieldsCache
1504-
quiet true
1505-
}
1506-
download.run {
1507-
src "${url}methods.csv"
1508-
dest methodsCache
1509-
quiet true
1510-
}
1511-
1512-
zipFile.getParentFile().mkdirs()
1513-
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))
1514-
1515-
zos.putNextEntry(new ZipEntry("fields.csv"))
1516-
Files.copy(Paths.get(fieldsCache), zos)
1517-
zos.closeEntry()
1518-
1519-
zos.putNextEntry(new ZipEntry("methods.csv"))
1520-
Files.copy(Paths.get(methodsCache), zos)
1521-
zos.closeEntry()
1522-
1523-
zos.close()
1524-
}
1525-
15261452
// Helper methods
15271453

15281454
def checkPropertyExists(String propertyName) {

dependencies.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
dependencies {
44
api('com.github.GTNewHorizons:BuildCraft:7.1.31:dev')
5-
implementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.41.310:dev')
6-
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.38-GTNH:dev')
5+
implementation('com.github.GTNewHorizons:GT5-Unofficial:5.09.42.83:dev')
6+
implementation('com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev')
77

8-
compileOnly('com.github.GTNewHorizons:OpenComputers:1.8.0.13-GTNH:api') {transitive = false}
9-
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-173-GTNH:api') {transitive = false}
8+
compileOnly('com.github.GTNewHorizons:OpenComputers:1.9.2-GTNH:api') {transitive = false}
9+
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-197-GTNH:api') {transitive = false}
1010
compileOnly('com.github.GTNewHorizons:StorageDrawers:1.11.20-GTNH:api') {transitive = false}
1111
compileOnly('com.github.GTNewHorizons:Jabba:1.2.22:dev') {transitive = false}
1212
compileOnly('com.github.GTNewHorizons:ironchest:6.0.71:dev') {transitive = false}
13-
compileOnly('com.github.GTNewHorizons:ForestryMC:4.5.8:dev') {transitive = false}
14-
compileOnly('com.github.GTNewHorizons:EnderIO:2.3.1.68:dev') {transitive = false}
13+
compileOnly('com.github.GTNewHorizons:ForestryMC:4.6.6:dev') {transitive = false}
14+
compileOnly('com.github.GTNewHorizons:EnderIO:2.4.11:dev') {transitive = false}
1515
compileOnly('com.github.GTNewHorizons:EnderCore:0.2.13:dev') {transitive = false}
1616
compileOnly('com.github.GTNewHorizons:EnderStorage:1.4.12:dev') {transitive = false}
17-
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.32:api') {transitive = false}
17+
compileOnly('com.github.GTNewHorizons:ExtraCells2:2.5.33:api') {transitive = false}
1818
compileOnly('com.github.GTNewHorizons:Binnie:2.0.48:dev') {transitive = false}
1919

2020
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') {transitive = false}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)