diff --git a/.gitignore b/.gitignore index 645db82..234f46c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Project exclude paths /.gradle/ /build/ -/.idea/ \ No newline at end of file +/.idea/ +/run/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index 27134cd..7728fe3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,9 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + plugins { - id 'fabric-loom' version '1.5-SNAPSHOT' + id 'fabric-loom' version '1.6-SNAPSHOT' id 'maven-publish' - id "org.jetbrains.kotlin.jvm" version "1.9.22" + id "org.jetbrains.kotlin.jvm" version "2.0.0" } version = project.mod_version @@ -17,16 +19,10 @@ repositories { // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. // See https://docs.gradle.org/current/userguide/declaring_repositories.html // for more information about repositories. - - maven { - name = "CottonMC" - url = "https://server.bbkr.space/artifactory/libs-release" - } - maven { url "https://maven.terraformersmc.com/" } } loom { - splitEnvironmentSourceSets() + splitEnvironmentSourceSets() mods { "scify" { @@ -46,13 +42,6 @@ dependencies { // Fabric API. This is technically optional, but you probably want it anyway. modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}" - - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" - // Uncomment the following line to enable the deprecated Fabric API modules. - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. - - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" - // implementation group: 'org.kohsuke', name: 'github-api', version: '1.318' } processResources { @@ -67,7 +56,7 @@ tasks.withType(JavaCompile).configureEach { it.options.release = 17 } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { +tasks.withType(KotlinCompile).configureEach { kotlinOptions { jvmTarget = 17 } @@ -92,7 +81,8 @@ jar { // configure the maven publication publishing { publications { - mavenJava(MavenPublication) { + create("mavenJava", MavenPublication) { + artifactId = project.archives_base_name from components.java } } diff --git a/gradle.properties b/gradle.properties index 27c9692..13942a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,17 @@ # gradle.properties +kotlin.code.style=official + # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.19.4 -yarn_mappings=1.19.4+build.2 -loader_version=0.15.6 -fabric_kotlin_version=1.10.17+kotlin.1.9.22 +minecraft_version=1.20.4 +yarn_mappings=1.20.4+build.3 +loader_version=0.15.11 +fabric_kotlin_version=1.11.0+kotlin.2.0.0 # yeah modmenu_version=9.0.0 @@ -20,4 +22,4 @@ maven_group=chickenmanfy.scify archives_base_name=scify # Dependencies -fabric_version=0.87.2+1.19.4 \ No newline at end of file +fabric_version=0.97.1+1.20.4 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..31042a6 100755 --- a/gradlew +++ b/gradlew @@ -246,4 +246,4 @@ eval "set -- $( tr '\n' ' ' )" '"$@"' -exec "$JAVACMD" "$@" +exec "$JAVACMD" "$@" \ No newline at end of file diff --git a/gradlew.bat b/gradlew.bat index 6689b85..13ba5d3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -89,4 +89,4 @@ exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal -:omega +:omega \ No newline at end of file diff --git a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt index c1be293..3ffef26 100644 --- a/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt +++ b/src/client/kotlin/chickenmanfy/scify/SciFyClient.kt @@ -1,7 +1,5 @@ package chickenmanfy.scify -import io.github.prospector.modmenu.api.ConfigScreenFactory -import io.github.prospector.modmenu.api.ModMenuApi import net.fabricmc.api.ClientModInitializer import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper @@ -10,64 +8,25 @@ import net.minecraft.client.option.KeyBinding import net.minecraft.client.util.InputUtil import net.minecraft.text.Text import org.lwjgl.glfw.GLFW -import net.fabricmc.api.EnvType -import net.fabricmc.api.Environment -import net.minecraft.client.gui.screen.Screen -import net.minecraft.client.gui.widget.ButtonWidget -import net.minecraft.client.util.math.MatrixStack object SciFyClient : ClientModInitializer { - override fun onInitializeClient() { - - val menu = KeyBindingHelper.registerKeyBinding( - KeyBinding( - "Menu", - InputUtil.Type.KEYSYM, - GLFW.GLFW_KEY_RIGHT_SHIFT, - "SciFy" - ) - ) - ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient -> - while (menu.wasPressed()) { - // Debug - client.player!!.sendMessage(Text.literal("Button input received."), true) + override fun onInitializeClient() { - } - }) - } + val menu = KeyBindingHelper.registerKeyBinding( + KeyBinding( + "Menu", + InputUtil.Type.KEYSYM, + GLFW.GLFW_KEY_RIGHT_SHIFT, + "SciFy" + ) + ) + ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient -> + while (menu.wasPressed()) { + // Debug + client.player!!.sendMessage(Text.literal("Button input received."), true) + + } + }) + } } - -@Environment(EnvType.CLIENT) -class ScifyModMenu : ModMenuApi { - override fun getModConfigScreenFactory(): ConfigScreenFactory<*> { - return ConfigScreenFactory<*> { parent -> menu(parent) } - } -} - - -@Environment(EnvType.CLIENT) -class menu(private val parent: Screen) : Screen(Text.literal("Your Mod Config")) { - override fun init() { - // Add a button to open Mod Menu - val modMenuButton = ButtonWidget.builder( - Text.literal("Mod Menu") - ) { button: ButtonWidget? -> - // Open Mod Menu - ModMenu.getInstance().openConfigScreen() - } - .dimensions(width / 2 - 100, height / 2, 200, 20) - .build() - - addDrawableChild(modMenuButton) - } - - override fun render(matrices: MatrixStack, mouseX: Int, mouseY: Int, delta: Float) { - renderBackground(matrices) - super.render(matrices, mouseX, mouseY, delta) - } - - fun onClose() { - client!!.setScreen(parent) - } -} \ No newline at end of file diff --git a/src/main/kotlin/chickenmanfy/scify/SciFy.kt b/src/main/kotlin/chickenmanfy/scify/SciFy.kt index 6910ed2..fd71ff8 100644 --- a/src/main/kotlin/chickenmanfy/scify/SciFy.kt +++ b/src/main/kotlin/chickenmanfy/scify/SciFy.kt @@ -3,6 +3,6 @@ package chickenmanfy.scify import net.fabricmc.api.ModInitializer object SciFy : ModInitializer { - override fun onInitialize() { - } + override fun onInitialize() { + } } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 74125fa..ba1d32b 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -3,15 +3,22 @@ "id": "scify", "version": "${version}", "name": "SciFy", - "description": "A Dungeonfy mod so good you'll think it's science fiction", + "description": "A Dungeonfy mod so good you'll think it's science fiction\n\n\nThanks to the Dungeonfy community for giving me something to do during summer -Chickenmanfy", "authors": [ - "Main Developer: Chickenmanfy", - "Server Owner: Enook", - "Thanks to Endr. for help with some bugs!" + { + "name": "Chickenmanfy", + "role": "Main Developer" + } + ], + "contributors": [ + { + "name": "Endr.", + "role": "Help with bugs" + } ], "contact": { - "homepage": "https://modrinth.com", - "sources": "https://github.com/chickenmanfy/scify/", + "homepage": "https://modrinth.com/project/scify", + "sources": "https://github.com/chickenmanfy/scify", "issues": "https://github.com/chickenmanfy/scify/issues" }, "license": "MPL-2.0", @@ -40,7 +47,7 @@ ], "depends": { "fabricloader": ">=0.15.6", - "minecraft": "~1.19.4", + "minecraft": "~1.20.4", "java": ">=17", "fabric-api": "*", "fabric-language-kotlin": ">=1.9.22"