diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..93a66be --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,23 @@ +pipeline { + agent any + + triggers { + pollSCM('*/10 * * * *') + } + stages { + stage('Build') { + steps { + echo 'Building..' + sh './gradlew publishToMavenLocal --stacktrace' + } + } + stage('Deploy') { + steps { + echo 'Deploying....' + dir('remappedJars') { + archiveArtifacts artifacts:'*.jar', fingerprint: false + } + } + } + } +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 9128f4f..bad3c7c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -73,9 +73,9 @@ allprojects { val shadowTask = getByName("shadowJar") as ShadowJar dependsOn(shadowTask) archiveBaseName.set(shadowTask.archiveBaseName) - if (!archiveBaseName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars")) input.set(shadowTask.archiveFile) archiveClassifier.set(this@allprojects.name) + if (!archiveFileName.get().contains("common")) destinationDirectory.set(file("$rootDir/remappedJars")) } withType(ProcessResources::class) { val modVersionPair: Pair = "mod_version" to (rootProject.version as String) diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt new file mode 100644 index 0000000..0b9f8d9 --- /dev/null +++ b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt @@ -0,0 +1,8 @@ +package fr.username404.snowygui + +import net.minecraft.client.gui.screens.Screen +import net.minecraft.network.chat.TranslatableComponent + +abstract class SnowyConfigScreen: Screen(TranslatableComponent("snowygui.config")) { + +} \ No newline at end of file diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index c8cd289..e224c9a 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -13,7 +13,7 @@ object Groups { architectury { platformSetupLoomIde(); fabric() } dependencies { - modApi("${Groups.Fabric}:fabric-loader:${rootProject.property("fabric_loader_version")}") + modImplementation("${Groups.Fabric}:fabric-loader:${rootProject.property("fabric_loader_version")}") modApi("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") include("${Groups.FabricApi}:fabric-resource-loader-v0:${rootProject.property("fabric_resource_loader_version")}") { isTransitive = false } modRuntime(modCompileOnly("com.terraformersmc:modmenu:${rootProject.property("modmenu_version")}") { diff --git a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/ModMenuConf.kt b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/ModMenuConf.kt index ca04a3d..5e33b9c 100644 --- a/fabric/src/main/kotlin/fr/username404/snowygui/fabric/ModMenuConf.kt +++ b/fabric/src/main/kotlin/fr/username404/snowygui/fabric/ModMenuConf.kt @@ -2,13 +2,13 @@ package fr.username404.snowygui.fabric import com.terraformersmc.modmenu.api.ConfigScreenFactory import com.terraformersmc.modmenu.api.ModMenuApi +import fr.username404.snowygui.config.SnowyConfigScreen import net.minecraft.client.gui.screens.Screen -import net.minecraft.network.chat.TranslatableComponent class ModMenuConf: ModMenuApi { override fun getModConfigScreenFactory(): ConfigScreenFactory { return ConfigScreenFactory { screen: Screen? -> - object : Screen(TranslatableComponent("snowygui.config")) { // TODO Actual config screen + object : SnowyConfigScreen() { // TODO Actual config screen override fun onClose() { minecraft!!.setScreen(screen) } diff --git a/forge/src/main/kotlin/fr/username404/snowygui/forge/forgeInit.kt b/forge/src/main/kotlin/fr/username404/snowygui/forge/forgeInit.kt index 20d4005..51948b4 100644 --- a/forge/src/main/kotlin/fr/username404/snowygui/forge/forgeInit.kt +++ b/forge/src/main/kotlin/fr/username404/snowygui/forge/forgeInit.kt @@ -1,11 +1,26 @@ package fr.username404.snowygui.forge import fr.username404.snowygui.CommonSnow +import fr.username404.snowygui.config.SnowyConfigScreen +import net.minecraftforge.fml.ExtensionPoint +import net.minecraftforge.fml.ModLoadingContext import net.minecraftforge.fml.common.Mod +import java.util.function.BiFunction +import java.util.function.Supplier @Mod("snowygui") class ForgeInit: CommonSnow() { init { atInit() + ModLoadingContext.get().registerExtensionPoint( + ExtensionPoint.CONFIGGUIFACTORY, + Supplier { + return@Supplier BiFunction { mc, screen -> + return@BiFunction object : SnowyConfigScreen() { + override fun onClose() { mc.setScreen(screen) } + } + } + } + ) } } \ No newline at end of file