aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-06-03 14:56:10 +0200
committernea <nea@nea.moe>2023-06-03 14:56:10 +0200
commitb3237fe53d4ff838984d65954772cf77588644ae (patch)
treedcc6c6245a60a11e84a004b0d0123e7568e54a21
parent9477a32ad577fc242fd83059826706fcea8c6f31 (diff)
downloadfirmament-b3237fe53d4ff838984d65954772cf77588644ae.tar.gz
firmament-b3237fe53d4ff838984d65954772cf77588644ae.tar.bz2
firmament-b3237fe53d4ff838984d65954772cf77588644ae.zip
Add auto hotswap installer
-rw-r--r--build.gradle.kts66
-rw-r--r--gradle/libs.versions.toml2
-rw-r--r--src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt4
3 files changed, 48 insertions, 24 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index a5a28d3..276d26c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -28,23 +28,6 @@ compileTestKotlin.kotlinOptions {
jvmTarget = "17"
}
-loom {
- clientOnlyMinecraftJar()
- accessWidenerPath.set(project.file("src/main/resources/firmament.accesswidener"))
- runs {
- removeIf { it.name != "client" }
- named("client") {
- property("devauth.enabled", "true")
- property("fabric.log.level", "info")
- property("firmament.debug", "true")
- /*
- vmArg("-XX:+AllowEnhancedClassRedefinition")
- vmArg("-XX:HotswapAgent=fatjar")
- */
- }
- }
-}
-
repositories {
maven("https://maven.terraformersmc.com/releases/")
maven("https://maven.shedaniel.me")
@@ -59,6 +42,17 @@ repositories {
includeGroup("com.unascribed")
}
}
+ ivy("https://github.com/HotswapProjects/HotswapAgent/releases/download") {
+ patternLayout {
+ artifact("[revision]/[artifact]-[revision].[ext]")
+ }
+ content {
+ includeGroup("virtual.github.hotswapagent")
+ }
+ metadataSources {
+ artifact()
+ }
+ }
maven("https://server.bbkr.space/artifactory/libs-release")
maven("https://repo.nea.moe/releases")
mavenLocal()
@@ -72,6 +66,10 @@ val transInclude by configurations.creating {
isTransitive = true
}
+val hotswap by configurations.creating {
+ isVisible = false
+}
+
val nonModImplentation by configurations.creating {
extendsFrom(shadowMe)
configurations.implementation.get().extendsFrom(this)
@@ -82,6 +80,9 @@ dependencies {
"minecraft"(libs.minecraft)
"mappings"("net.fabricmc:yarn:${libs.versions.yarn.get()}:v2")
+ // Hotswap Dependency
+ hotswap(libs.hotswap)
+
// Fabric dependencies
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.kotlin)
@@ -123,22 +124,46 @@ dependencies {
version = rootProject.property("mod_version").toString()
group = rootProject.property("maven_group").toString()
+loom {
+ clientOnlyMinecraftJar()
+ accessWidenerPath.set(project.file("src/main/resources/firmament.accesswidener"))
+ runs {
+ removeIf { it.name != "client" }
+ named("client") {
+ property("devauth.enabled", "true")
+ property("fabric.log.level", "info")
+ property("firmament.debug", "true")
+
+ vmArg("-ea")
+ vmArg("-XX:+AllowEnhancedClassRedefinition")
+ vmArg("-XX:HotswapAgent=external")
+ vmArg("-javaagent:${hotswap.resolve().single().absolutePath}")
+ }
+ }
+}
+
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
+tasks.jar {
+ destinationDirectory.set(layout.buildDirectory.dir("badjars"))
+ archiveClassifier.set("slim")
+}
+
tasks.shadowJar {
configurations = listOf(shadowMe)
- archiveClassifier.set("dev-thicc")
+ archiveClassifier.set("")
relocate("io.github.moulberry.repo", "moe.nea.firmament.deps.repo")
}
tasks.remapJar {
+ destinationDirectory.set(layout.buildDirectory.dir("badjars"))
injectAccessWidener.set(true)
inputFile.set(tasks.shadowJar.flatMap { it.archiveFile })
dependsOn(tasks.shadowJar)
- archiveClassifier.set("thicc")
+ archiveClassifier.set("dev")
}
tasks.processResources {
@@ -151,9 +176,6 @@ tasks.processResources {
filesMatching("**/fabric.mod.json") {
expand(*replacements.toTypedArray())
}
- filesMatching("**/lang/*.json") {
- // flattenJson(this)
- }
from(tasks.scanLicenses)
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index b1187bf..d73e42c 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -15,6 +15,7 @@ neurepoparser = "1.2.0"
qolify = "1.2.2-1.19.4"
citresewn = "1.1.3+1.19.4"
lib39 = "1.4.2"
+hotswap_agent = "1.4.2-SNAPSHOT"
ncr = "Fabric-1.19.4-v2.1.1"
[libraries]
@@ -31,6 +32,7 @@ libgui = { module = "io.github.cottonmc:LibGui", version.ref = "libgui" }
lib39_core = { module = "com.unascribed:lib39-core", version.ref = "lib39" }
# Runtime:
+hotswap = { module = "virtual.github.hotswapagent:hotswap-agent", version.ref = "hotswap_agent" }
architectury_fabric = { module = "dev.architectury:architectury-fabric", version.ref = "architectury" }
rei_fabric = { module = "me.shedaniel:RoughlyEnoughItems-fabric", version.ref = "rei" }
devauth = { module = "me.djtheredstoner:DevAuth-fabric", version.ref = "devauth" }
diff --git a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt
index 0c3e5c8..bf412b9 100644
--- a/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt
+++ b/src/main/kotlin/moe/nea/firmament/gui/profileviewer/PetsPage.kt
@@ -4,9 +4,9 @@ import io.github.cottonmc.cotton.gui.client.BackgroundPainter
import io.github.cottonmc.cotton.gui.widget.TooltipBuilder
import io.github.cottonmc.cotton.gui.widget.WGridPanel
import io.github.cottonmc.cotton.gui.widget.WItem
-import io.github.cottonmc.cotton.gui.widget.WScrollPanel
import io.github.cottonmc.cotton.gui.widget.WText
import io.github.cottonmc.cotton.gui.widget.WWidget
+import io.github.cottonmc.cotton.gui.widget.data.InputResult
import io.github.cottonmc.cotton.gui.widget.data.Insets
import io.github.cottonmc.cotton.gui.widget.icon.Icon
import io.github.cottonmc.cotton.gui.widget.icon.ItemIcon
@@ -14,9 +14,9 @@ import net.minecraft.client.item.TooltipContext
import net.minecraft.client.util.math.MatrixStack
import net.minecraft.item.Items
import net.minecraft.text.Text
-import moe.nea.firmament.gui.WFixedPanel
import moe.nea.firmament.gui.WTightScrollPanel
import moe.nea.firmament.rei.SBItemStack
+import moe.nea.firmament.util.MC
object PetsPage : ProfilePage {
override fun getElements(profileViewer: ProfileViewer): WWidget {