···11+#
22+# https://help.github.com/articles/dealing-with-line-endings/
33+#
44+# Linux start script should use lf
55+/gradlew text eol=lf
66+77+# These are Windows script files and should use crlf
88+*.bat text eol=crlf
99+
+38
.github/workflows/build.yml
···11+# Automatically build the project and run any configured tests for every push
22+# and submitted pull request. This can help catch issues that only occur on
33+# certain platforms or Java versions, and provides a first line of defence
44+# against bad commits.
55+66+name: build
77+on: [pull_request, push]
88+99+jobs:
1010+ build:
1111+ strategy:
1212+ matrix:
1313+ # Use these Java versions
1414+ java: [
1515+ 17, # Current Java LTS & minimum supported by Minecraft
1616+ 21, # Current Java LTS
1717+ ]
1818+ runs-on: ubuntu-22.04
1919+ steps:
2020+ - name: checkout repository
2121+ uses: actions/checkout@v4
2222+ - name: validate gradle wrapper
2323+ uses: gradle/wrapper-validation-action@v2
2424+ - name: setup jdk ${{ matrix.java }}
2525+ uses: actions/setup-java@v4
2626+ with:
2727+ java-version: ${{ matrix.java }}
2828+ distribution: 'microsoft'
2929+ - name: make gradle wrapper executable
3030+ run: chmod +x ./gradlew
3131+ - name: build
3232+ run: ./gradlew build
3333+ - name: capture build artifacts
3434+ if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java
3535+ uses: actions/upload-artifact@v4
3636+ with:
3737+ name: Artifacts
3838+ path: build/libs/
···11+Creative Commons Legal Code
22+33+CC0 1.0 Universal
44+55+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
66+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
77+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
88+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
99+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
1010+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
1111+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
1212+ HEREUNDER.
1313+1414+Statement of Purpose
1515+1616+The laws of most jurisdictions throughout the world automatically confer
1717+exclusive Copyright and Related Rights (defined below) upon the creator
1818+and subsequent owner(s) (each and all, an "owner") of an original work of
1919+authorship and/or a database (each, a "Work").
2020+2121+Certain owners wish to permanently relinquish those rights to a Work for
2222+the purpose of contributing to a commons of creative, cultural and
2323+scientific works ("Commons") that the public can reliably and without fear
2424+of later claims of infringement build upon, modify, incorporate in other
2525+works, reuse and redistribute as freely as possible in any form whatsoever
2626+and for any purposes, including without limitation commercial purposes.
2727+These owners may contribute to the Commons to promote the ideal of a free
2828+culture and the further production of creative, cultural and scientific
2929+works, or to gain reputation or greater distribution for their Work in
3030+part through the use and efforts of others.
3131+3232+For these and/or other purposes and motivations, and without any
3333+expectation of additional consideration or compensation, the person
3434+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
3535+is an owner of Copyright and Related Rights in the Work, voluntarily
3636+elects to apply CC0 to the Work and publicly distribute the Work under its
3737+terms, with knowledge of his or her Copyright and Related Rights in the
3838+Work and the meaning and intended legal effect of CC0 on those rights.
3939+4040+1. Copyright and Related Rights. A Work made available under CC0 may be
4141+protected by copyright and related or neighboring rights ("Copyright and
4242+Related Rights"). Copyright and Related Rights include, but are not
4343+limited to, the following:
4444+4545+ i. the right to reproduce, adapt, distribute, perform, display,
4646+ communicate, and translate a Work;
4747+ ii. moral rights retained by the original author(s) and/or performer(s);
4848+iii. publicity and privacy rights pertaining to a person's image or
4949+ likeness depicted in a Work;
5050+ iv. rights protecting against unfair competition in regards to a Work,
5151+ subject to the limitations in paragraph 4(a), below;
5252+ v. rights protecting the extraction, dissemination, use and reuse of data
5353+ in a Work;
5454+ vi. database rights (such as those arising under Directive 96/9/EC of the
5555+ European Parliament and of the Council of 11 March 1996 on the legal
5656+ protection of databases, and under any national implementation
5757+ thereof, including any amended or successor version of such
5858+ directive); and
5959+vii. other similar, equivalent or corresponding rights throughout the
6060+ world based on applicable law or treaty, and any national
6161+ implementations thereof.
6262+6363+2. Waiver. To the greatest extent permitted by, but not in contravention
6464+of, applicable law, Affirmer hereby overtly, fully, permanently,
6565+irrevocably and unconditionally waives, abandons, and surrenders all of
6666+Affirmer's Copyright and Related Rights and associated claims and causes
6767+of action, whether now known or unknown (including existing as well as
6868+future claims and causes of action), in the Work (i) in all territories
6969+worldwide, (ii) for the maximum duration provided by applicable law or
7070+treaty (including future time extensions), (iii) in any current or future
7171+medium and for any number of copies, and (iv) for any purpose whatsoever,
7272+including without limitation commercial, advertising or promotional
7373+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
7474+member of the public at large and to the detriment of Affirmer's heirs and
7575+successors, fully intending that such Waiver shall not be subject to
7676+revocation, rescission, cancellation, termination, or any other legal or
7777+equitable action to disrupt the quiet enjoyment of the Work by the public
7878+as contemplated by Affirmer's express Statement of Purpose.
7979+8080+3. Public License Fallback. Should any part of the Waiver for any reason
8181+be judged legally invalid or ineffective under applicable law, then the
8282+Waiver shall be preserved to the maximum extent permitted taking into
8383+account Affirmer's express Statement of Purpose. In addition, to the
8484+extent the Waiver is so judged Affirmer hereby grants to each affected
8585+person a royalty-free, non transferable, non sublicensable, non exclusive,
8686+irrevocable and unconditional license to exercise Affirmer's Copyright and
8787+Related Rights in the Work (i) in all territories worldwide, (ii) for the
8888+maximum duration provided by applicable law or treaty (including future
8989+time extensions), (iii) in any current or future medium and for any number
9090+of copies, and (iv) for any purpose whatsoever, including without
9191+limitation commercial, advertising or promotional purposes (the
9292+"License"). The License shall be deemed effective as of the date CC0 was
9393+applied by Affirmer to the Work. Should any part of the License for any
9494+reason be judged legally invalid or ineffective under applicable law, such
9595+partial invalidity or ineffectiveness shall not invalidate the remainder
9696+of the License, and in such case Affirmer hereby affirms that he or she
9797+will not (i) exercise any of his or her remaining Copyright and Related
9898+Rights in the Work or (ii) assert any associated claims and causes of
9999+action with respect to the Work, in either case contrary to Affirmer's
100100+express Statement of Purpose.
101101+102102+4. Limitations and Disclaimers.
103103+104104+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105105+ surrendered, licensed or otherwise affected by this document.
106106+ b. Affirmer offers the Work as-is and makes no representations or
107107+ warranties of any kind concerning the Work, express, implied,
108108+ statutory or otherwise, including without limitation warranties of
109109+ title, merchantability, fitness for a particular purpose, non
110110+ infringement, or the absence of latent or other defects, accuracy, or
111111+ the present or absence of errors, whether or not discoverable, all to
112112+ the greatest extent permissible under applicable law.
113113+ c. Affirmer disclaims responsibility for clearing rights of other persons
114114+ that may apply to the Work or any use thereof, including without
115115+ limitation any person's Copyright and Related Rights in the Work.
116116+ Further, Affirmer disclaims responsibility for obtaining any necessary
117117+ consents, permissions or other rights required for any use of the
118118+ Work.
119119+ d. Affirmer understands and acknowledges that Creative Commons is not a
120120+ party to this document and has no duty or obligation with respect to
121121+ this CC0 or use of the Work.
+87
build.gradle
···11+plugins {
22+ id 'fabric-loom' version '1.6-SNAPSHOT'
33+ id 'maven-publish'
44+}
55+66+version = project.mod_version
77+group = project.maven_group
88+99+base {
1010+ archivesName = project.archives_base_name
1111+}
1212+1313+repositories {
1414+ // Add repositories to retrieve artifacts from in here.
1515+ // You should only use this when depending on other mods because
1616+ // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
1717+ // See https://docs.gradle.org/current/userguide/declaring_repositories.html
1818+ // for more information about repositories.
1919+}
2020+2121+loom {
2222+ splitEnvironmentSourceSets()
2323+2424+ mods {
2525+ "teleport_commands" {
2626+ sourceSet sourceSets.main
2727+ sourceSet sourceSets.client
2828+ }
2929+ }
3030+3131+}
3232+3333+dependencies {
3434+ // To change the versions see the gradle.properties file
3535+ minecraft "com.mojang:minecraft:${project.minecraft_version}"
3636+ mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
3737+ modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
3838+3939+ // Fabric API. This is technically optional, but you probably want it anyway.
4040+ modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
4141+4242+}
4343+4444+processResources {
4545+ inputs.property "version", project.version
4646+4747+ filesMatching("fabric.mod.json") {
4848+ expand "version": project.version
4949+ }
5050+}
5151+5252+tasks.withType(JavaCompile).configureEach {
5353+ it.options.release = 17
5454+}
5555+5656+java {
5757+ // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
5858+ // if it is present.
5959+ // If you remove this line, sources will not be generated.
6060+ withSourcesJar()
6161+6262+ sourceCompatibility = JavaVersion.VERSION_17
6363+ targetCompatibility = JavaVersion.VERSION_17
6464+}
6565+6666+jar {
6767+ from("LICENSE") {
6868+ rename { "${it}_${project.base.archivesName.get()}"}
6969+ }
7070+}
7171+7272+// configure the maven publication
7373+publishing {
7474+ publications {
7575+ create("mavenJava", MavenPublication) {
7676+ from components.java
7777+ }
7878+ }
7979+8080+ // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
8181+ repositories {
8282+ // Add repositories to publish to here.
8383+ // Notice: This block does NOT have the same function as the block in the top level.
8484+ // The repositories here will be used for publishing your artifact, not for
8585+ // retrieving dependencies.
8686+ }
8787+}
+17
gradle.properties
···11+# Done to increase the memory available to gradle.
22+org.gradle.jvmargs=-Xmx2G
33+org.gradle.parallel=true
44+55+# Fabric Properties
66+# check these on https://fabricmc.net/develop
77+minecraft_version=1.20.4
88+yarn_mappings=1.20.4+build.3
99+loader_version=0.15.9
1010+1111+# Mod Properties
1212+mod_version=1.0.0
1313+maven_group=dev.mrsnowy.teleport_commands
1414+archives_base_name=teleport_commands
1515+1616+# Dependencies
1717+fabric_version=0.97.0+1.20.4
···11+@rem
22+@rem Copyright 2015 the original author or authors.
33+@rem
44+@rem Licensed under the Apache License, Version 2.0 (the "License");
55+@rem you may not use this file except in compliance with the License.
66+@rem You may obtain a copy of the License at
77+@rem
88+@rem https://www.apache.org/licenses/LICENSE-2.0
99+@rem
1010+@rem Unless required by applicable law or agreed to in writing, software
1111+@rem distributed under the License is distributed on an "AS IS" BASIS,
1212+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313+@rem See the License for the specific language governing permissions and
1414+@rem limitations under the License.
1515+@rem
1616+1717+@if "%DEBUG%"=="" @echo off
1818+@rem ##########################################################################
1919+@rem
2020+@rem Gradle startup script for Windows
2121+@rem
2222+@rem ##########################################################################
2323+2424+@rem Set local scope for the variables with windows NT shell
2525+if "%OS%"=="Windows_NT" setlocal
2626+2727+set DIRNAME=%~dp0
2828+if "%DIRNAME%"=="" set DIRNAME=.
2929+@rem This is normally unused
3030+set APP_BASE_NAME=%~n0
3131+set APP_HOME=%DIRNAME%
3232+3333+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
3434+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
3535+3636+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3737+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3838+3939+@rem Find java.exe
4040+if defined JAVA_HOME goto findJavaFromJavaHome
4141+4242+set JAVA_EXE=java.exe
4343+%JAVA_EXE% -version >NUL 2>&1
4444+if %ERRORLEVEL% equ 0 goto execute
4545+4646+echo. 1>&2
4747+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
4848+echo. 1>&2
4949+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
5050+echo location of your Java installation. 1>&2
5151+5252+goto fail
5353+5454+:findJavaFromJavaHome
5555+set JAVA_HOME=%JAVA_HOME:"=%
5656+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757+5858+if exist "%JAVA_EXE%" goto execute
5959+6060+echo. 1>&2
6161+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
6262+echo. 1>&2
6363+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
6464+echo location of your Java installation. 1>&2
6565+6666+goto fail
6767+6868+:execute
6969+@rem Setup the command line
7070+7171+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7272+7373+7474+@rem Execute Gradle
7575+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
7676+7777+:end
7878+@rem End local scope for the variables with windows NT shell
7979+if %ERRORLEVEL% equ 0 goto mainEnd
8080+8181+:fail
8282+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8383+rem the _cmd.exe /c_ return code!
8484+set EXIT_CODE=%ERRORLEVEL%
8585+if %EXIT_CODE% equ 0 set EXIT_CODE=1
8686+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
8787+exit /b %EXIT_CODE%
8888+8989+:mainEnd
9090+if "%OS%"=="Windows_NT" endlocal
9191+9292+:omega
···11+package dev.mrsnowy.teleport_commands;
22+33+import net.fabricmc.api.ClientModInitializer;
44+55+public class TeleportCommandsClient implements ClientModInitializer {
66+ @Override
77+ public void onInitializeClient() {
88+ // This entrypoint is suitable for setting up client-specific logic, such as rendering.
99+ }
1010+}
···11+package dev.mrsnowy.teleport_commands;
22+33+import net.fabricmc.api.ModInitializer;
44+55+import org.slf4j.Logger;
66+import org.slf4j.LoggerFactory;
77+88+public class TeleportCommands implements ModInitializer {
99+ // This logger is used to write text to the console and the log file.
1010+ // It is considered best practice to use your mod id as the logger's name.
1111+ // That way, it's clear which mod wrote info, warnings, and errors.
1212+ public static final Logger LOGGER = LoggerFactory.getLogger("teleport_commands");
1313+1414+ @Override
1515+ public void onInitialize() {
1616+ // This code runs as soon as Minecraft is in a mod-load-ready state.
1717+ // However, some things (like resources) may still be uninitialized.
1818+ // Proceed with mild caution.
1919+2020+ LOGGER.info("Hello Fabric world!");
2121+ }
2222+}