From f9e0df935c85da69a490b8cda7b3093aa78ee55e Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Fri, 4 Feb 2022 18:03:35 +0000 Subject: [PATCH] Switch to special-purpose loom fork & quilt + mojang layered mappings --- .gitignore | 2 -- .gitmodules | 9 ++++++ README.md | 27 +++++++++++++++++ build.gradle.kts | 29 +++++++------------ build_src/fabric-loom | 1 + build_src/quilt-mappings-on-loom | 1 + settings.gradle.kts | 4 +++ .../codes/som/hibiscus/gui/ImGuiScreen.kt | 2 +- vendor | 1 + 9 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 .gitmodules create mode 160000 build_src/fabric-loom create mode 160000 build_src/quilt-mappings-on-loom create mode 160000 vendor diff --git a/.gitignore b/.gitignore index 03a177f..f67f5c6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ *.iws /run/ - -/vendor/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..aa94bdf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "build_src/quilt-mappings-on-loom"] + path = build_src/quilt-mappings-on-loom + url = https://git.lavender.software/hibiscus-client/quilt-mappings-on-loom.git +[submodule "build_src/fabric-loom"] + path = build_src/fabric-loom + url = https://git.lavender.software/hibiscus-client/fabric-loom.git +[submodule "vendor"] + path = vendor + url = https://git.lavender.software/hibiscus-client/vendored-jars.git diff --git a/README.md b/README.md index a00ce15..ab3faca 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,30 @@ # hibiscus client :) + +## Setup + +```shell +$ git clone --recursive "https://git.lavender.software/hibiscus-client/hibiscus.git" +$ cd hibiscus/ +hibiscus/ $ # [open IntelliJ IDEA or something here, otherwise:] +hibiscus/ $ ./gradlew runClient +``` + +**Make sure you clone recursive!** If you didn't, just: + +```shell +hibiscus/ $ git submodule update --init +``` + +You may want to also mark the `run` and `vendor` folders as excluded in IntelliJ. + +To authenticate from the IDE, you can create a lastlogin.txt file in `run/` (already gitignored) with the following structure. + +```text +me@example.com +my super secure minecraft password +``` + +This is handled by *unknit*'s `MixinMinecraftMain`, and logs your account in at game start-up. +If you do not trust having the file within the project directory, you can set the `LOGIN_FILE` environment variable. diff --git a/build.gradle.kts b/build.gradle.kts index caa9b3a..192b73b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,9 +3,10 @@ import org.quiltmc.quiltmappings.loom.QuiltMappingsOnLoomPlugin plugins { id("fabric-loom") + id("org.quiltmc.quilt-mappings-on-loom") + val kotlinVersion: String by System.getProperties() kotlin("jvm").version(kotlinVersion) - id("org.quiltmc.quilt-mappings-on-loom").version("3.1.1") } base { @@ -18,31 +19,21 @@ version = modVersion val mavenGroup: String by project group = mavenGroup -minecraft {} - repositories {} dependencies { val minecraftVersion: String by project minecraft("com.mojang:minecraft:$minecraftVersion") - val USE_QUILT_MAPPINGS = false - if (USE_QUILT_MAPPINGS) { - // Seems to crash on startup right now + val quiltMappings: String by project + mappings(loom.layered { + officialMojangMappings { + nameSyntheticMembers = false + } - val quiltMappings: String by project - mappings(loom.layered { - officialMojangMappings { - nameSyntheticMembers = false - } - - val qm = extensionOf(project, "quiltMappings") as QuiltMappingsOnLoomPlugin.QuiltMappingsOnLoomExtension - addLayer(qm.mappings("org.quiltmc:quilt-mappings:${quiltMappings}:v2")) - }) - } else { - val yarnMappings: String by project - mappings("net.fabricmc:yarn:$yarnMappings:v2") - } + val qm = extensionOf(project, "quiltMappings") as QuiltMappingsOnLoomPlugin.QuiltMappingsOnLoomExtension + addLayer(qm.mappings("org.quiltmc:quilt-mappings:${quiltMappings}:v2")) + }) val loaderVersion: String by project modImplementation("net.fabricmc:fabric-loader:$loaderVersion") diff --git a/build_src/fabric-loom b/build_src/fabric-loom new file mode 160000 index 0000000..71c28bb --- /dev/null +++ b/build_src/fabric-loom @@ -0,0 +1 @@ +Subproject commit 71c28bbcd075d6d0c45dcdde71246e61ccb661e3 diff --git a/build_src/quilt-mappings-on-loom b/build_src/quilt-mappings-on-loom new file mode 160000 index 0000000..c635aee --- /dev/null +++ b/build_src/quilt-mappings-on-loom @@ -0,0 +1 @@ +Subproject commit c635aeea01c722ac27c8f1d81796415d4096fa7c diff --git a/settings.gradle.kts b/settings.gradle.kts index 5d35d71..856987f 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,6 @@ +includeBuild("build_src/fabric-loom") +includeBuild("build_src/quilt-mappings-on-loom") + pluginManagement { repositories { maven("https://maven.fabricmc.net") { name = "Fabric" } @@ -8,6 +11,7 @@ pluginManagement { plugins { val loomVersion: String by settings id("fabric-loom").version(loomVersion) + val kotlinVersion: String by System.getProperties() kotlin("jvm").version(kotlinVersion) } diff --git a/src/main/kotlin/codes/som/hibiscus/gui/ImGuiScreen.kt b/src/main/kotlin/codes/som/hibiscus/gui/ImGuiScreen.kt index ae60661..4cece41 100644 --- a/src/main/kotlin/codes/som/hibiscus/gui/ImGuiScreen.kt +++ b/src/main/kotlin/codes/som/hibiscus/gui/ImGuiScreen.kt @@ -11,5 +11,5 @@ object ImGuiScreen : Screen(Text.of("hacker menu")) { ModuleControlsUI.render(delta) } - override fun shouldPause() = false + override fun isPauseScreen() = false } diff --git a/vendor b/vendor new file mode 160000 index 0000000..717d6a9 --- /dev/null +++ b/vendor @@ -0,0 +1 @@ +Subproject commit 717d6a90f064371fb15e2bc33a6d86cf2552a6ec