diff --git a/.editorconfig b/.editorconfig index 0908154..4899471 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,12 +7,15 @@ insert_final_newline = true tab_width = 4 trim_trailing_whitespace = true -[*.gradle] +[*.gradle.kts] indent_style = tab [*.java] indent_style = tab +[*.kt] +indent_size = tab + [*.json] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..99d0367 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,30 @@ +*.java text eol=lf diff=java +*.gradle text eol=lf diff=java +*.kt text eol=lf diff=kotlin +*.kts text eol=lf diff=kotlin +gradlew text eol=lf +*.bat text eol=crlf + +*.md text eol=lf diff=markdown + +.editorconfig text eol=lf + +*.json text eol=lf +*.json5 text eol=lf +*.properties text eol=lf +*.toml text eol=lf +*.xml text eol=lf diff=html + +# Modding specific +*.accesswidener text eol=lf + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.class binary +*.dll binary +*.ear binary +*.jar binary +*.jks binary +*.png binary +*.so binary +*.war binary diff --git a/.gitignore b/.gitignore index d891204..2d5c207 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ out/ classes/ # Quilt Loom +remappedSrc/ run/ -!saves # Eclipse *.launch @@ -17,6 +17,9 @@ run/ *.ipr *.iws +# Fleet +.fleet/ + # Visual Studio Code .settings/ .vscode/ @@ -29,9 +32,6 @@ workspace/ # macOS *.DS_Store -obsidian/Stellarworks/.obsidian/ -/obsidian/Stellarworks/ASSETS/WIP TEXTURES/ -#obsidian stuff - #minecraft -obsidian/Stellarworks/ASSETS/VanillaDefault+1.20 +# Other +obsidian/ diff --git a/Sine-Termino.code-workspace b/Sine-Termino.code-workspace deleted file mode 100644 index 15c77e1..0000000 --- a/Sine-Termino.code-workspace +++ /dev/null @@ -1,10 +0,0 @@ -{ - "folders": [ - { - "path": "." - } - ], - "settings": { - "java.configuration.updateBuildConfiguration": "automatic" - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c148052..462a2de 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,6 @@ 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. - } // All the dependencies are declared at gradle/libs.version.toml and referenced with "libs." diff --git a/gradle.properties b/gradle.properties index 5ca2733..495f00b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,23 +1,8 @@ -# Gradle Properties -org.gradle.jvmargs = -Xmx1G -org.gradle.parallel = true - -modid=sine-termino - -# Mod Properties -version = 0.1.0 -maven_group = xyz.limepot -archives_base_name = stellarworks -projchangelog = Changelog! - - -# Modrinth Metadata -modrinth_slug= stellarworks -modrinth_id= 3WyZOm8r -modrinth_game_versions= 1.20-1.20.1 -modrinth_mod_loaders= quilt - -#ignore - -# Dependencies are managed at gradle/libs.versions.toml +org.gradle.jvmargs=-Xmx1G -XX:MaxMetaspaceSize=1G +org.gradle.parallel=true +kotlin.incremental=true +kotlin.code.style=official +group=com.example +version=1.0.0 +archives_base_name=quilt-kotlin-template-mod diff --git a/gradlew b/gradlew index a69d9cb..aeb74cb 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -80,13 +80,10 @@ do esac done -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -APP_NAME="Gradle" +# This is normally unused +# shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -143,12 +140,16 @@ fi if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then case $MAX_FD in #( max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 MAX_FD=$( ulimit -H -n ) || warn "Could not query maximum file descriptor limit" esac case $MAX_FD in #( '' | soft) :;; #( *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 ulimit -n "$MAX_FD" || warn "Could not set maximum file descriptor limit to $MAX_FD" esac @@ -193,6 +194,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 53a6b23..93e3f59 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,91 +1,92 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -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. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -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. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +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. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +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. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/settings.gradle.kts b/settings.gradle.kts index f3a695b..c1e43e2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -14,3 +14,5 @@ pluginManagement { mavenCentral() } } + +rootProject.name = "stellarworks" diff --git a/src/main/java/xyz/limepot/stellarworks/Stellarworks.java b/src/main/java/xyz/limepot/stellarworks/Stellarworks.java deleted file mode 100644 index f9ed36c..0000000 --- a/src/main/java/xyz/limepot/stellarworks/Stellarworks.java +++ /dev/null @@ -1,39 +0,0 @@ -package xyz.limepot.stellarworks; - -import org.quiltmc.loader.api.ModContainer; -import org.quiltmc.qsl.base.api.entrypoint.ModInitializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import xyz.limepot.stellarworks.block.ModBlocks; -import xyz.limepot.stellarworks.block.entity.ModBlockEntities; -import xyz.limepot.stellarworks.item.ModItemGroup; -import xyz.limepot.stellarworks.item.ModItems; -import xyz.limepot.stellarworks.world.ModFeatures; - -@SuppressWarnings("ALL") -public class Stellarworks implements ModInitializer { - - - public static final String MOD_ID = "stellarworks"; - - // This logger is used to write text to the console and the log file. - // It is considered best practice to use your mod name as the logger's name. - // That way, it's clear which mod wrote info, warnings, and errors. - public static final Logger LOGGER = LoggerFactory.getLogger("Stellarworks"); - - @Override - public void onInitialize(ModContainer mod) { - //ModConfiguredFeatures MUST ALWAYS be called first - ModFeatures.registerFeatures(); - //BIOME MODS - PLEASE LEAVE DIRECTLY AFTER FEATURE REGISTRY & IN THE MAIN CLASS (FOR NOW IDK HOW TO PUT IT IN IT'S OWN) - ///BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, ALUMINIUM_ORE_PLACED_KEY); - ///BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, TIN_ORE_PLACED_KEY); - ////Basic Registries - ModItems.registerModItems(); - ModBlocks.registerModBlocks(); - ModBlockEntities.registerBlockEntities(); - ModItemGroup.registerItemGroups(); - LOGGER.debug(MOD_ID + ": Registered!"); - LOGGER.warn("Sine Termino has initialized, See you in the stars!"); - } -} diff --git a/src/main/java/xyz/limepot/stellarworks/block/ModBlocks.java b/src/main/java/xyz/limepot/stellarworks/block/ModBlocks.java index 7f8553b..1dbfd96 100644 --- a/src/main/java/xyz/limepot/stellarworks/block/ModBlocks.java +++ b/src/main/java/xyz/limepot/stellarworks/block/ModBlocks.java @@ -59,7 +59,7 @@ public class ModBlocks { } public static void registerModBlocks() { - Stellarworks.LOGGER.debug("Registering Blocks..."); + Stellarworks.INSTANCE.getLOGGER().debug("Registering Blocks..."); } } diff --git a/src/main/java/xyz/limepot/stellarworks/item/ModItemGroup.java b/src/main/java/xyz/limepot/stellarworks/item/ModItemGroup.java index 807809c..1a226a7 100644 --- a/src/main/java/xyz/limepot/stellarworks/item/ModItemGroup.java +++ b/src/main/java/xyz/limepot/stellarworks/item/ModItemGroup.java @@ -46,6 +46,6 @@ public class ModItemGroup { }).build()); public static void registerItemGroups() { - Stellarworks.LOGGER.debug("Registering Creative Tab Entries..."); + Stellarworks.INSTANCE.getLOGGER().debug("Registering Creative Tab Entries..."); } } diff --git a/src/main/java/xyz/limepot/stellarworks/item/ModItems.java b/src/main/java/xyz/limepot/stellarworks/item/ModItems.java index d643e9d..28ce0b3 100644 --- a/src/main/java/xyz/limepot/stellarworks/item/ModItems.java +++ b/src/main/java/xyz/limepot/stellarworks/item/ModItems.java @@ -66,7 +66,7 @@ public class ModItems { } public static void registerModItems() { - Stellarworks.LOGGER.debug("Registering Items...."); + Stellarworks.INSTANCE.getLOGGER().debug("Registering Items...."); } } diff --git a/src/main/java/xyz/limepot/stellarworks/mixin/TitleScreenMixin.java b/src/main/java/xyz/limepot/stellarworks/mixin/TitleScreenMixin.java index a015241..5e2d458 100644 --- a/src/main/java/xyz/limepot/stellarworks/mixin/TitleScreenMixin.java +++ b/src/main/java/xyz/limepot/stellarworks/mixin/TitleScreenMixin.java @@ -12,6 +12,6 @@ import xyz.limepot.stellarworks.Stellarworks; public class TitleScreenMixin { @Inject(method = "init", at = @At("TAIL")) public void onInit(CallbackInfo ci) { - Stellarworks.LOGGER.debug("Minced in."); + Stellarworks.INSTANCE.getLOGGER().debug("Minced in."); } } diff --git a/src/main/java/xyz/limepot/stellarworks/world/ModFeatures.java b/src/main/java/xyz/limepot/stellarworks/world/ModFeatures.java index c3125a1..e96490b 100644 --- a/src/main/java/xyz/limepot/stellarworks/world/ModFeatures.java +++ b/src/main/java/xyz/limepot/stellarworks/world/ModFeatures.java @@ -13,7 +13,7 @@ public class ModFeatures { public static final RegistryKey TIN_ORE_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier("stellarworks","tin_ore")); public static void registerFeatures() { - Stellarworks.LOGGER.debug("Registering Features..."); + Stellarworks.INSTANCE.getLOGGER().debug("Registering Features..."); } } diff --git a/src/main/kotlin/xyz/limepot/stellarworks/Stellarworks.kt b/src/main/kotlin/xyz/limepot/stellarworks/Stellarworks.kt new file mode 100644 index 0000000..732216e --- /dev/null +++ b/src/main/kotlin/xyz/limepot/stellarworks/Stellarworks.kt @@ -0,0 +1,29 @@ +package xyz.limepot.stellarworks + +import org.quiltmc.loader.api.ModContainer +import org.quiltmc.qsl.base.api.entrypoint.ModInitializer +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import xyz.limepot.stellarworks.block.ModBlocks +import xyz.limepot.stellarworks.block.entity.ModBlockEntities +import xyz.limepot.stellarworks.item.ModItemGroup +import xyz.limepot.stellarworks.item.ModItems +import xyz.limepot.stellarworks.world.ModFeatures + +object Stellarworks : ModInitializer { + const val MOD_ID: String = "stellarworks" + val LOGGER: Logger = LoggerFactory.getLogger("Stellarworks") + + override fun onInitialize(mod: ModContainer) { + //ModConfiguredFeatures MUST ALWAYS be called first + ModFeatures.registerFeatures() + //BIOME MODS - PLEASE LEAVE DIRECTLY AFTER FEATURE REGISTRY & IN THE MAIN CLASS (FOR NOW IDK HOW TO PUT IT IN IT'S OWN) + ///BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, ALUMINIUM_ORE_PLACED_KEY); + ///BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, TIN_ORE_PLACED_KEY); + ////Basic Registries + ModItems.registerModItems() + ModBlocks.registerModBlocks() + ModBlockEntities.registerBlockEntities() + ModItemGroup.registerItemGroups() + } +} diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json index 43e8c91..ab42e5e 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/quilt.mod.json @@ -17,25 +17,32 @@ }, "icon": "assets/stellarworks/icon.png" }, + "intermediate_mappings": "net.fabricmc:intermediary", "entrypoints": { - "init": "xyz.limepot.stellarworks.Stellarworks", - "clientmod": "xyz.limepot.stellarworks.StellarworksClient" + "init": { + "adapter": "kotlin", + "value": "xyz.limepot.stellarworks.Stellarworks" + } }, "depends": [ { "id": "quilt_loader", - "versions": ">=0.19.1" + "versions": ">=0.23.1" }, { "id": "quilted_fabric_api", - "versions": ">=7.0.3" + "versions": ">=7.5.0" + }, + { + "id": "qkl", + "versions": ">=2.1.0" }, { "id": "minecraft", - "versions": ">=1.20-" + "versions": ">=1.20.1-" } ] }, "mixin": "stellarworks.mixins.json" - } +}