From 217e531731bc46330af2890478d36ba205d04fef Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 20 Aug 2022 02:16:11 +0200 Subject: Loomering --- .github/workflows/build.yml | 10 +- .gitignore | 1 + build.gradle | 104 --------------------- build.gradle.kts | 93 ++++++++++++++++++ gradle.properties | 5 +- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 22 +++++ .../com/thatgravyboat/skyblockhud/SkyblockHud.java | 3 +- src/main/resources/mcmod.info | 6 +- 9 files changed, 130 insertions(+), 116 deletions(-) delete mode 100644 build.gradle create mode 100644 build.gradle.kts create mode 100644 settings.gradle.kts diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d0c2f9..4c443ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,10 +19,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: '17' - uses: actions/cache@v2 with: path: | @@ -37,7 +37,7 @@ jobs: run: ./gradlew build - uses: actions/upload-artifact@v2 with: - path: build/libs/*.jar + path: build/libs/*-all.jar - name: Stop gradle daemons run: ./gradlew --stop @@ -47,10 +47,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 17 - name: Prettify the Java Code uses: lwerner-lshigh/prettier_action_java@v1.1.1 with: diff --git a/.gitignore b/.gitignore index d4b8715..7c5be2c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ deps # other eclipse run +.vscode .DS_Store \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 10c1e20..0000000 --- a/build.gradle +++ /dev/null @@ -1,104 +0,0 @@ -buildscript { - repositories { - maven { - name = 'jitpack' - url = 'https://jitpack.io/' - } - maven { url = 'https://maven.minecraftforge.net/' } - maven { url = 'https://repo.spongepowered.org/maven' } - } - dependencies { - classpath 'com.github.asbyth:ForgeGradle:8708bf3e01' - classpath 'com.github.xcfrg:MixinGradle:0.6-SNAPSHOT' - classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0' - } -} - -apply plugin: 'java' -apply plugin: 'net.minecraftforge.gradle.forge' -apply plugin: 'org.spongepowered.mixin' -apply plugin: 'com.github.johnrengelman.shadow' - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -version = '1.14.3' -group= 'com.thatgravyboat.skyblockhud' -archivesBaseName = 'SkyBlockHud' -String mixinClassifier = 'dep' - -minecraft { - version = '1.8.9-11.15.1.2318-1.8.9' - runDir = 'run' - mappings = 'stable_22' -} - -repositories { - maven { url 'https://repo.spongepowered.org/maven/' } - flatDir { - dirs 'deps' - } -} - -dependencies { - compile('org.spongepowered:mixin:0.7.11-SNAPSHOT') - annotationProcessor('org.spongepowered:mixin:0.7.11-SNAPSHOT') -} - -mixin { - add sourceSets.main, 'mixins.skyblockhud.refmap.json' -} - -jar { - manifest.attributes( - 'TweakClass': 'org.spongepowered.asm.launch.MixinTweaker', - 'MixinConfigs': 'mixins.skyblockhud.json', - 'FMLCorePluginContainsFMLMod': true, - 'ForceLoadAsMod': true - ) -} - -shadowJar { - dependencies { - include(dependency('org.spongepowered:mixin:0.7.11-SNAPSHOT')) - } - exclude 'module-info.class' - exclude 'dummyThing' - exclude 'LICENSE.txt' - - archiveClassifier.set(mixinClassifier) -} - -reobf { - shadowJar { - mappingType = 'SEARGE' - } -} - -build.dependsOn(shadowJar) -runClient.dependsOn(build) - -processResources - { - inputs.property 'version', project.version - inputs.property 'mcversion', project.minecraft.version - - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } - - rename '(.+_at.cfg)', 'META-INF/$1' - } -task moveResources { - doLast { - ant.move file: "${buildDir}/resources/main", - todir: "${buildDir}/classes/java" - } -} -moveResources.dependsOn processResources -classes.dependsOn moveResources \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..6a04c49 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,93 @@ +plugins { + idea + java + id("gg.essential.loom") version "0.10.0.+" + id("dev.architectury.architectury-pack200") version "0.1.3" + id("com.github.johnrengelman.shadow") version "7.1.2" +} + +version = "1.14.3" +group = "com.thatgravyboat.skyblockhud" + + +java { + toolchain.languageVersion.set(JavaLanguageVersion.of(8)) +} + +loom { + launchConfigs { + "client" { + property("mixin.debug", "true") + property("asmhelper.verbose", "true") + arg("--tweakClass", "org.spongepowered.asm.launch.MixinTweaker") + arg("--mixin", "mixins.skyblockhud.json") + } + } + forge { + pack200Provider.set(dev.architectury.pack200.java.Pack200Adapter()) + mixinConfig("mixins.skyblockhud.json") + } + mixin { + defaultRefmapName.set("mixins.skyblockhud.refmap.json") + } +} + +sourceSets.main { + output.setResourcesDir(file("$buildDir/classes/java/main")) +} + +repositories { + mavenCentral() + maven("https://repo.spongepowered.org/maven/") + maven("https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1") +} + +dependencies { + minecraft("com.mojang:minecraft:1.8.9") + mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") + forge("net.minecraftforge:forge:1.8.9-11.15.1.2318-1.8.9") + + + implementation("org.spongepowered:mixin:0.7.11-SNAPSHOT") + annotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") + + modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") +} + + +tasks.withType(Jar::class) { + manifest.attributes.run { + this["FMLCorePluginContainsFMLMod"] = "true" + this["ForceLoadAsMod"] = "true" + this["TweakClass"] = "org.spongepowered.asm.launch.MixinTweaker" + this["MixinConfigs"] = "mixins.skyblockhud.json" + } +} + +tasks.processResources { + inputs.property("version", project.version) + filesMatching("mcmod.info") { + expand( + "version" to project.version + ) + } +} + +tasks.shadowJar { + dependencies { + include(dependency("org.spongepowered:mixin:0.7.11-SNAPSHOT")) + } + exclude ("LICENSE.txt") + + archiveClassifier.set("dep-dev") +} + + +val remapJar by tasks.named("remapJar") { + archiveClassifier.set("all") + from(tasks.shadowJar) + input.set(tasks.shadowJar.get().archiveFile) +} + +tasks.assemble.get().dependsOn(tasks.remapJar) + diff --git a/gradle.properties b/gradle.properties index bf86fb7..50b0909 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,4 @@ -org.gradle.jvmargs=-Xmx2G \ No newline at end of file +org.gradle.jvmargs=-Xmx2G +loom.platform=forge + + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 71a1ffc..8ad73a7 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..769caf5 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,22 @@ + +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + maven("https://oss.sonatype.org/content/repositories/snapshots") + maven("https://maven.architectury.dev/") + maven("https://maven.fabricmc.net") + maven("https://maven.minecraftforge.net/") + maven("https://repo.spongepowered.org/maven/") + maven("https://repo.sk1er.club/repository/maven-releases/") + } + resolutionStrategy { + eachPlugin { + when (requested.id.id) { + "gg.essential.loom" -> useModule("gg.essential:architectury-loom:${requested.version}") + } + } + } +} + +rootProject.name = "SkyblockHud-Reborn" diff --git a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java index 99f04e9..f9ef417 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/SkyblockHud.java @@ -48,11 +48,10 @@ import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent; import org.lwjgl.input.Keyboard; -@Mod(modid = SkyblockHud.MODID, version = SkyblockHud.VERSION) +@Mod(modid = SkyblockHud.MODID, useMetadata = true) public class SkyblockHud { public static final String MODID = "skyblockhud"; - public static final String VERSION = "1.13"; public static SBHConfig config; diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 28064d7..40dac37 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -4,10 +4,10 @@ "name": "Skyblock Hud", "description": "Hypixel Skyblock RPG HUD", "version": "${version}", - "mcversion": "${mcversion}", - "url": "", + "mcversion": "1.8.9", + "url": "https://github.com/RayDeeUx/SkyblockHud-Reborn", "updateUrl": "", - "authorList": ["ThatGravyBoat"], + "authorList": ["ThatGravyBoat", "RayDeezNuts"], "credits": "Map Icons by ModCruel", "logoFile": "", "screenshots": [], -- cgit