Initial commit

This commit is contained in:
nelle 2024-04-10 15:57:17 -06:00
commit 5cecbe4b50
23 changed files with 881 additions and 0 deletions

33
.editorconfig Normal file
View file

@ -0,0 +1,33 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.gradle]
indent_style = tab
[*.java]
indent_style = tab
[*.json]
indent_style = space
indent_size = 2
[quilt.mod.json]
indent_style = tab
tab_width = 2
[*.toml]
indent_style = tab
tab_width = 2
[*.properties]
indent_style = space
indent_size = 2

30
.gitattributes vendored Normal file
View file

@ -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

34
.gitignore vendored Normal file
View file

@ -0,0 +1,34 @@
# Gradle
.gradle/
build/
out/
classes/
# Quilt Loom
remappedSrc/
run/
# Eclipse
*.launch
# IntelliJ Idea
.idea/
*.iml
*.ipr
*.iws
# Fleet
.fleet/
# Visual Studio Code
.settings/
.vscode/
bin/
.classpath
.project
# Eclipse JDT LS
workspace/
# macOS
*.DS_Store

26
LICENSE.md Normal file
View file

@ -0,0 +1,26 @@
# The Unlicense
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>

View file

@ -0,0 +1,20 @@
-----BEGIN PGP MESSAGE-----
owGVU01IFUEcf/bsUUNhIQVC1pSQQa/nQYSUKEM8GEqfTwOjmt2dfTu6O7POzPp4
QuRHQQZmYR8EBXWpS0YhFUESQdGxDkGXCIIORSAdggKJ+s++50d16rCwM/P//39f
M+dXJhOo8mIT6vp55NSGssnkkJXq2t3W2XrAGau9XoNbRFiQLOdpnCesn0rsCol3
eFqHqqmuzhYOtajMZYTM1bWzgO4TmmhRd1BT3ycyL2Sv2olQG3aow2yiKSa8AJ+D
ie9je34245pKqswP1h5TWAlX54mkWAvYoCiMLJ/Z2BEBYTyD23BAemmxtDSaCR5z
g2psUU5dprFw42WpmWgEnHI0xi/OhWYtgTaPa4MC9iiTKi5QkW1TpYRUBs4QNF0A
iBYBwhTLzMMCrNGY2PEcSX3G+yKmvHgyaAqpDKmOmC6Yc9COQpBrDg2UG+kIpMZW
qCKzxRZE3AHfF8zyST6D0CFRkqrmuPdykfepUxJoAQnqps2BLTiotCJDGcTBSMqg
VyIBAxkHOpBJpD0hKfQVcEAxGGnqABhCB4ZSBDiUDLbjTHHeY7YHvniknyLQzlwG
ZaaF+EoUY5w3vphaMXao4EKDu1YPBbdArO0TFigEGhYkAglhGOKQSM2o+g+93KA7
rJ85EfHT2IoU45BjGsTmCGcDcXBpnDOJcZNP2ogtosHKROQRFd/Tf+8nAhl/G5qO
4dswcV0mAyBJNKzyDC64URpf1D8aUFxinIhR80xBINyOAnhJ1MmgMw/KE5UoUb12
Y/m7ysdV1Xve1366NjU+90aXLjEvM4GWr5rbeXW67Fd77sSX6epj7vOZzvvTucEX
DcMDUz3dT8ZSwxNnn93qtvb+mB2ayVbfHnn5vWYUD34NvLvrR1KXKsa/Hc5u3fw5
UTabGn2At5+7uWv6uHeZPqq/UXWv0Xm4Ltzf0jrZ8bEm2beiZuLClWXkzpunbsXr
bc1XPxzNJuuzm7Y0vz3ZuKZjdcNv
=xpr8
-----END PGP MESSAGE-----

17
License/WAIVER Normal file
View file

@ -0,0 +1,17 @@
# Copyright waiver for <https://codeberg.org/LimePotato/Stellarworks>
I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
To the best of my knowledge and belief, my contributions are either
originally authored by me or are derived from prior works which I have
verified are also in the public domain and are not subject to claims
of copyright by other parties.
To the best of my knowledge and belief, no individual, business,
organization, government, or other entity has any copyright interest
in my contributions, and I affirm that I will not make contributions
that are otherwise encumbered.

32
README.md Normal file
View file

@ -0,0 +1,32 @@
# Quilt Template Mod
Based on the official template mod, this mod is modified to preconfigure things like mod menu support that I normally add anyways to my mods.
## Usage
1. clone this repository
2. rename from ``limepot-quilt-template-mod`` to your mod name
3. cd into the directory
4. run the ``interactive-setup.sh`` script (bash required)
if you havent just forked this repository, and make one after cloning:
1. git remote remove origin
2. git remote add origin ``your git repository here``
3. git push
### please note the below is for personal use, if you decide to use my template mod you do not need to use the unlicense.
### Contributing:
I wont tell you exactly how to contribute but I will say, you must cryptographically sign the [waiver](License/WAIVER) and include it in your first commit.
``gpg --no-version --armor --sign WAIVER``
## License
I dedicate any and all copyright interest in this software to the
public domain. I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors. I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
![pd-icon](https://user-images.githubusercontent.com/9313366/208296032-a39e4144-ab3d-4abc-af51-074d2ac678fe.png)
See [Unlicense](https://unlicense.org).

6
TEMPLATE_TODO.md Normal file
View file

@ -0,0 +1,6 @@
- [ ] make interactive script update quilt automatically?
- [ ] cleanup the script to not be so redundant (specifically the domain/namespace shit)
- [ ] add option to install optional mods to run config (Mod Menu, and other dev-helpful mods)
- [ ] scrub the README.md to be inline with a default description of the mod
- [ ] interactively ask user for new repo and add correct commits for changes?
- [ ] optional modmenu quilt.mod.json configuration setup?

88
build.gradle Normal file
View file

@ -0,0 +1,88 @@
plugins {
id 'maven-publish'
alias libs.plugins.quilt.loom
}
base.archivesName = project.archives_base_name
version = "$project.version"
group = project.maven_group
repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// 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.<id>"
// See https://docs.gradle.org/current/userguide/platforms.html for information on how version catalogs work.
dependencies {
minecraft libs.minecraft
mappings variantOf(libs.quilt.mappings) { classifier 'intermediary-v2' }
// Replace the above line with the block below if you want to use Mojang mappings as your primary mappings, falling back on QM for parameters and Javadocs
/*
mappings loom.layered {
mappings "org.quiltmc:quilt-mappings:${libs.versions.quilt.mappings.get()}:intermediary-v2"
officialMojangMappings()
}
*/
modImplementation libs.quilt.loader
// QSL is not a complete API; You will need Quilted Fabric API to fill in the gaps.
// Quilted Fabric API will automatically pull in the correct QSL version.
modImplementation libs.quilted.fabric.api
// modImplementation libs.bundles.quilted.fabric.api // If you wish to use Fabric API's deprecated modules, you can replace the above line with this one
}
processResources {
inputs.property 'version', version
filesMatching('quilt.mod.json') {
expand 'version': version
}
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
}
java {
// Still required by IDEs such as Eclipse and Visual Studio Code
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with development.
// Uncomment this line to generate them.
// withJavadocJar()
}
// If you plan to use a different file for the license, don't forget to change the file name here!
jar {
from('LICENSE') {
rename { "${it}_${base.archivesName.get()}" }
}
}
// Configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
repositories {
// Add repositories to publish to here.
// Notice: This block does NOT have the same function as the block in the top level.
// The repositories here will be used for publishing your artifact, not for
// retrieving dependencies.
}
}

0
changelog.md Normal file
View file

10
gradle.properties Normal file
View file

@ -0,0 +1,10 @@
# Gradle Properties
org.gradle.jvmargs = -Xmx1G
org.gradle.parallel = true
# Mod Properties
version = 0.0.1
maven_group = com.example
archives_base_name = example_mod
# Dependencies are managed at gradle/libs.versions.toml

22
gradle/libs.versions.toml Normal file
View file

@ -0,0 +1,22 @@
[versions]
# The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html
minecraft = "1.20.1"
quilt_mappings = "1.20.1+build.9"
quilt_loader = "0.23.0-beta.1"
quilted_fabric_api = "7.4.0+0.90.0-1.20.1"
[libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }
quilt_mappings = { module = "org.quiltmc:quilt-mappings", version.ref = "quilt_mappings" }
quilt_loader = { module = "org.quiltmc:quilt-loader", version.ref = "quilt_loader" }
quilted_fabric_api = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api", version.ref = "quilted_fabric_api" }
quilted_fabric_api_deprecated = { module = "org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated", version.ref = "quilted_fabric_api" }
# If you have multiple similar dependencies, you can declare a dependency bundle and reference it on the build script with "libs.bundles.example".
[bundles]
quilted_fabric_api = ["quilted_fabric_api", "quilted_fabric_api_deprecated"]
[plugins]
quilt_loom = { id = "org.quiltmc.loom", version = "1.2.+" }

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

245
gradlew vendored Executable file
View file

@ -0,0 +1,245 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# 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/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
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
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
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
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored Normal file
View file

@ -0,0 +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=.
@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

116
interactive-setup.sh Executable file
View file

@ -0,0 +1,116 @@
#!/bin/bash
echo 'Welcome! We will ask you a few questions to get set up.'
echo 'please note if you fuck up typing you will fuck up your mod, but you can fix it manually cant you :)'
echo '______'
echo 'First lets get your mod name and description'
echo '______'
echo 'Human Readable Mod Name:'
read modnamehr
echo 'Mod Name - example_mod :'
read modnameus
echo 'Mod Name - Case - ExampleMod:'
read modnamecase
echo 'Mod Description - "this mod does stuff!"'
read moddesc
echo '______'
echo 'okay now lets get some information about you'
echo '______'
echo 'Your Name - or Username:'
read uname
echo 'Your website - backwards - com.example:'
read website
echo 'now split it up... so'
echo 'website tld - ie "com" from com.example'
read websitetld
echo 'and the root.. ie "example" from com.example'
read websiteroot
echo '______'
echo 'okay now some links!'
echo '______'
echo 'Mod Homepage - (NO HTTPS://DFASDF/) - example.com:'
read homepage
echo 'you will have to manually edit the "source" and "issues" section of the quilt.mod.json'
echo '______'
# list vars
echo 'OK. here is what you typed...'
echo $modnamehr, $modnameus, $modnamecase, $uname, $website, $homepage, $websiteld, $websiteroot, $moddesc
echo '______'
echo 'Setting you up....'
# edit gradle properties
sed -i ./gradle.properties -e "7s/com.example/${website}/"
sed -i ./gradle.properties -e "8s/example_mod/${modnameus}/"
# edit namespace
## Folders
###################something is going wrong here, it doesnt know how to rename the folder?????????????
mv ./src/main/java/com ./src/main/java/${websitetld}
mv ./src/main/java/${websitetld}/example ./src/main/java/${websitetld}/${websiteroot}
mv ./src/main/java/${websitetld}/${websiteroot}/example_mod ./src/main/java/${websitetld}/${websiteroot}/${modnameus}
mv ./src/main/resources/assets/example_mod ./src/main/resources/assets/${modnameus}
## Packages/filenames
mv ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/ExampleMod.java ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/${modnamecase}.java
mv ./src/main/resources/example_mod.mixins.json ./src/main/resources/${modnameus}.mixins.json
# edit file lines.... this is going to suck to type out lol....
####remember sed -i <FILE-TO-EDIT> -e "<line>s/<texttoedit>/<texttoinpu>"
## Main Package
### package
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/${modnamecase}.java -e "1s/com.example.example_mod/${websitetld}.${websiteroot}.${modnameus}/"
### class
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/${modnamecase}.java -e "8s/ExampleMod/${modnamecase}/"
### MOD_ID
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/${modnamecase}.java -e "10s/example_mod/${modnameus}/"
### Logger Name
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/${modnamecase}.java -e "15s/Example Mod/${modnamehr}/"
## TitleScreenMixin
### package
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/mixin/TitleScreenMixin.java -e "1s/com.example.example_mod/${websitetld}.${websiteroot}.${modnameus}/"
### Main Class Import
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/mixin/TitleScreenMixin.java -e "3s/com.example.example_mod.ExampleMod/${websitetld}.${websiteroot}.${modnameus}.${modnamecase}/"
### Logger Class
sed -i ./src/main/java/${websitetld}/${websiteroot}/${modnameus}/mixin/TitleScreenMixin.java -e "14s/ExampleMod/${modnamecase}/"
## RESOURCES (mixins.json and quilt.mod.json)
### package name in *.mixins.json
sed -i ./src/main/resources/${modnameus}.mixins.json -e "4s/com.example.example_mod/${websitetld}.${websiteroot}.${modnameus}/"
#### quilt.mod.json
### group section
sed -i ./src/main/resources/quilt.mod.json -e "4s/com.example/${websitetld}.${websiteroot}/"
### id section
sed -i ./src/main/resources/quilt.mod.json -e "5s/example_mod/${modnameus}/"
### name section
sed -i ./src/main/resources/quilt.mod.json -e "8s/Mod name/${modnamehr}/"
### description section
sed -i ./src/main/resources/quilt.mod.json -e "9s/A short description of your mod./${moddesc}/"
### contributors section
sed -i ./src/main/resources/quilt.mod.json -e "11s/Your name here/${uname}/"
### homepage section
sed -i ./src/main/resources/quilt.mod.json -e "14s/example.com/${homepage}/"
### icon secion
sed -i ./src/main/resources/quilt.mod.json -e "18s/example_mod/${modnameus}/"
### entrypoints init section
sed -i ./src/main/resources/quilt.mod.json -e "22s/com.example.example_mod.ExampleMod/${websitetld}.${websiteroot}.${modnameus}.${modnamecase}/"
### mixin section
sed -i ./src/main/resources/quilt.mod.json -e "39s/example_mod/${modnameus}/"

14
settings.gradle Normal file
View file

@ -0,0 +1,14 @@
pluginManagement {
repositories {
maven {
name = 'Quilt'
url = 'https://maven.quiltmc.org/repository/release'
}
// Currently needed for Intermediary and other temporary dependencies
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
gradlePluginPortal()
}
}

View file

@ -0,0 +1,21 @@
package com.example.example_mod;
import org.quiltmc.loader.api.ModContainer;
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExampleMod implements ModInitializer {
public static final String MOD_ID = "example_mod";
// 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("Example Mod");
@Override
public void onInitialize(ModContainer mod) {
LOGGER.info("Howdy World from {}!", mod.metadata().name());
}
}

View file

@ -0,0 +1,16 @@
package com.example.example_mod.mixin;
import com.example.example_mod.ExampleMod;
import net.minecraft.client.gui.screen.TitleScreen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(TitleScreen.class)
public class TitleScreenMixin {
@Inject(method = "init", at = @At("TAIL"))
public void onInit(CallbackInfo ci) {
ExampleMod.LOGGER.info("MIXED UP~! or was it supposed to be in?");
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

View file

@ -0,0 +1,13 @@
{
"required": true,
"minVersion": "0.8",
"package": "com.example.example_mod.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [],
"client": [
"TitleScreenMixin"
],
"injectors": {
"defaultRequire": 1
}
}

View file

@ -0,0 +1,40 @@
{
"schema_version": 1,
"quilt_loader": {
"group": "com.example",
"id": "example_mod",
"version": "${version}",
"metadata": {
"name": "Mod Name",
"description": "A short description of your mod.",
"contributors": {
"Your name here": "Owner"
},
"contact": {
"homepage": "https://example.com/",
"issues": "https://github.com/QuiltMC/quilt-template-mod/issues",
"sources": "https://github.com/QuiltMC/quilt-template-mod"
},
"icon": "assets/example_mod/icon.png"
},
"intermediate_mappings": "net.fabricmc:intermediary",
"entrypoints": {
"init": "com.example.example_mod.ExampleMod"
},
"depends": [
{
"id": "quilt_loader",
"versions": ">=0.19.1"
},
{
"id": "quilted_fabric_api",
"versions": ">=7.0.3"
},
{
"id": "minecraft",
"versions": ">=1.20-"
}
]
},
"mixin": "example_mod.mixins.json"
}