├── patches ├── api │ └── .gitkeep └── server │ ├── .gitkeep │ └── 0001-MyAirplaneFork-branding.patch ├── gradle.properties ├── subprojects ├── server.gradle.kts └── api.gradle.kts ├── .gitmodules ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle.kts ├── LICENSE ├── gradlew.bat ├── gradlew └── README.md /patches/api/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /patches/server/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | org.gradle.jvmargs=-Xmx2G 3 | -------------------------------------------------------------------------------- /subprojects/server.gradle.kts: -------------------------------------------------------------------------------- 1 | repositories { 2 | } 3 | 4 | dependencies { 5 | } 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Airplane"] 2 | path = Airplane 3 | url = https://github.com/Technove/Airplane.git 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TECHNOVE/MyAirplaneFork/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /subprojects/api.gradle.kts: -------------------------------------------------------------------------------- 1 | repositories { 2 | } 3 | 4 | dependencies { 5 | } 6 | 7 | java { 8 | withJavadocJar() 9 | } 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | MyAirplaneFork-API 2 | MyAirplaneFork-Server 3 | 4 | last-airplane 5 | build/ 6 | .gradle/ 7 | 8 | launcher-*.jar 9 | mcdevimports.json 10 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | import xyz.jpenilla.toothpick.setupToothpickProject 2 | import java.util.Locale 3 | 4 | enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") 5 | 6 | pluginManagement { 7 | repositories { 8 | gradlePluginPortal() 9 | mavenCentral() 10 | maven("https://repo.jpenilla.xyz/snapshots") 11 | } 12 | } 13 | 14 | plugins { 15 | id("xyz.jpenilla.toothpick.settings") version "1.1.0-SNAPSHOT" 16 | } 17 | 18 | val forkName = "MyAirplaneFork" 19 | rootProject.name = forkName.toLowerCase(Locale.ROOT) 20 | setupToothpickProject(rootProject, forkName) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Burn Games LLC 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /patches/server/0001-MyAirplaneFork-branding.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Paul Sauve 3 | Date: Wed, 3 Feb 2021 23:02:38 -0600 4 | Subject: [PATCH] MyAirplaneFork branding 5 | 6 | 7 | diff --git a/pom.xml b/pom.xml 8 | index efa2ea6b8422f900643eb2f0f65cf067c034cea3..1cd91deffb55e31f6a1f11af69b1fa3aa17abcf0 100644 9 | --- a/pom.xml 10 | +++ b/pom.xml 11 | @@ -39,8 +39,8 @@ 12 | 13 | 14 | 15 | - gg.airplane 16 | - airplane-api 17 | + com.mygroupid 18 | + myairplanefork-api 19 | ${project.version} 20 | compile 21 | 22 | diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java 23 | index 5460f57f0473868b3fb09c526a1767f717a2740e..3072ae4ab8fff7e53d1ff8b56fe762d14e3baea8 100644 24 | --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java 25 | +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java 26 | @@ -29,8 +29,8 @@ public class PaperVersionFetcher implements VersionFetcher { 27 | @Nonnull 28 | @Override 29 | public Component getVersionMessage(@Nonnull String serverVersion) { 30 | - String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Tuinity 31 | - final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Tuinity 32 | + String[] parts = serverVersion.substring("git-MyAirplaneFork-".length()).split("[-\\s]"); // Tuinity // MyAirplaneFork 33 | + final Component updateMessage = getUpdateStatusMessage("MyGithubName/MyAirplaneFork", GITHUB_BRANCH_NAME, parts[0]); // Tuinity // MyAirplaneFork 34 | final Component history = getHistory(); 35 | 36 | return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; 37 | diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java 38 | index 26f423d3fdc958764758573043310f84da08a08e..0c013dd8e17e84e9c006d61bbc9d3ca830c1cd6c 100644 39 | --- a/src/main/java/net/minecraft/server/MinecraftServer.java 40 | +++ b/src/main/java/net/minecraft/server/MinecraftServer.java 41 | @@ -1650,7 +1650,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! 46 | + return "MyAirplaneFork"; // MyAirplaneFork // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! 47 | } 48 | 49 | public CrashReport b(CrashReport crashreport) { 50 | diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 51 | index eab5bd32860d136864ca8f74be264236cf530910..6263352e543449fe1f62b7576f9b896e96caec4f 100644 52 | --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java 53 | +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java 54 | @@ -230,7 +230,7 @@ import javax.annotation.Nullable; // Paper 55 | import javax.annotation.Nonnull; // Paper 56 | 57 | public final class CraftServer implements Server { 58 | - private final String serverName = "Airplane"; // Paper // Tuinity // Airplane 59 | + private final String serverName = "MyAirplaneFork"; // Paper // Tuinity // Airplane // MyAirplaneFork 60 | private final String serverVersion; 61 | private final String bukkitVersion = Versioning.getBukkitVersion(); 62 | private final Logger logger = Logger.getLogger("Minecraft"); 63 | diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java 64 | index 1788d79ea489e446d3d9f541693d4ba3dfc26015..0e18f778a434b8b22bb595f06cc6ef7833e64489 100644 65 | --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java 66 | +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java 67 | @@ -11,7 +11,7 @@ public final class Versioning { 68 | public static String getBukkitVersion() { 69 | String result = "Unknown-Version"; 70 | 71 | - InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane 72 | + InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.mygroupid/myairplanefork-api/pom.properties"); // Tuinity // Airplane 73 | Properties properties = new Properties(); 74 | 75 | if (stream != null) { 76 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyAirplaneFork 2 | 3 | A template project for forking Airplane! 4 | 5 | **NOTE: This is for 1.16 ONLY** 6 | 7 | ## Initial Setup 8 | 9 | Fork this repository to your own repo, then clone it locally. Once you've cloned it, you can setup the patches: 10 | ```bash 11 | cd MyAirplaneFork 12 | ./gradlew applyPatches 13 | # or on windows (STRONGLY DISCOURAGED - see below) 14 | gradlew.bat applyPatches 15 | ``` 16 | 17 | This will set up the entire project, as once it's done everything will be ready to go! 18 | 19 | ### Windows 20 | Using Windows? Click [here](#step-by-step-guide-for-windows-using-wsl) to view the Windows Guide. 21 | 22 | ## Working on the fork 23 | 24 | Once it applies the patches, you'll have two directories: `MyAirplaneFork-API`, and `MyAirplaneFork-Server`. 25 | Inside the `MyAirplaneFork-API` you should be somewhat familiar seeing the Bukkit library. 26 | Any interfaces to the server you want to expose to plugins, should go in this project. 27 | 28 | Inside of `MyAirplaneFork-Server`, you'll find the actual implementation of the API. 29 | Here is where you can make logic changes to the server, with the power to change anything in the implementation that you want! 30 | 31 | ## What is a patch file? 32 | 33 | In order to not distribute any of Mojang's assets, a `.patch` file is basically the exact same thing as a Git commit. 34 | It represents a change to the server, and applies on top of previous changes, which includes Mojang's original Minecraft server code. 35 | (and CraftBukkit, and Spigot, and Paper, and Tuinity, and Airplane..) 36 | 37 | Each patch represents 1 commit inside the respective project. 38 | `patches/api` adds commits to `MyAirplaneFork-API`, while `patches/server` adds commits to `MyAirplaneFork-Server`. 39 | Both of `MyAirplaneFork-API` and `MyAirplaneFork-Server` have their own git repository inside them, however there's no remote (like GitHub) that you push these repositories to. 40 | Instead, they get built from all the patches you have in your `patches` folder. 41 | 42 | So if you want to create a new patch, just add a commit to either the API or Server folder, and all you need to do to generate the patch is: 43 | 44 | ```bash 45 | ./gradlew rebuildPatches 46 | # or on windows 47 | gradlew.bat rebuildPatches 48 | ``` 49 | 50 | This command takes your commits, and turns them back into the actual patch files that you push. 51 | You should make sure that your fork never has the API and Server folders pushed, and just the `patches/api` and `patches/server` pushed. 52 | 53 | ## How do I update the upstream? 54 | 55 | This step is fairly easy, assuming there's no merge errors. To update the upstream (Airplane), all you have to do is run: 56 | 57 | ```bash 58 | ./gradlew updateUpstream 59 | # or on windows 60 | gradlew.bat updateUpstream 61 | ``` 62 | 63 | Then to rebuild the API & Server folders with your patches, just reapply them: 64 | 65 | ```bash 66 | ./gradlew applyPatches 67 | # or on windows 68 | gradlew.bat applyPatches 69 | ``` 70 | 71 | You may at times run into an merge conflict when applying patches, this happens when 2 patches modify similar areas of code, and the system can't figure out how to make them work together. 72 | You'll see in your terminal what files had a conflict, once you solve the files go into the project (either the API or Server) and run the following: 73 | 74 | ```bash 75 | # this will add your fixed changes 76 | git add --all 77 | # this will continue the process of applying the patches 78 | git am --continue 79 | ``` 80 | 81 | Once all your patches apply successfully, all you have to do is make sure you're in the main folder and run: 82 | 83 | ```bash 84 | ./gradlew rebuildPatches 85 | # or on windows 86 | gradlew.bat rebuildPatches 87 | ``` 88 | 89 | Finally, you have two options for making the commit: 90 | 91 | ```bash 92 | git add --all 93 | git commit -m 'Description of my changes' 94 | ``` 95 | 96 | Or if you want a fancy commit message that lists the upstream changes, you can just run 97 | 98 | ```bash 99 | git add --all 100 | 101 | ./gradlew upstreamCommit 102 | # or on windows 103 | gradlew.bat upstreamCommit 104 | ``` 105 | 106 | With that, you've successfully updated your fork! 107 | 108 | ## Building the fork 109 | 110 | If you're just building the fork to test, you can run: 111 | 112 | ```bash 113 | ./gradlew build 114 | # or on windows 115 | gradlew.bat build 116 | ``` 117 | 118 | Which will output your final JAR at `MyAirplaneFork-Server/build/libs/myairplanefork-server-1.16.5-R0.1-SNAPSHOT.jar`. 119 | However, you should not distribute this JAR outside testing because it contains Mojang's copyrighted Minecraft code. 120 | Instead, you can use the following command to generate a JAR that downloads Mojang's server when it's ran, and applies your changes on top: 121 | 122 | ```bash 123 | ./gradlew paperclip 124 | # or on windows 125 | gradle.bat paperclip 126 | ``` 127 | 128 | This will output your distributable JAR at `launcher-myairplanefork.jar`, right in your main directory! 129 | 130 | # Step-by-Step Guide for Windows using WSL 131 | This is a step-by-step guide on how to fork Airplane on Windows with WSL. You should still read the above information to get to grips with how to patch the plugin, however. 132 | 133 | ## 1. Setting up WSL 134 | This guide will require you to use Windows Subsystem for Linux (or, just Linux). We'll be using the Debian distribution, but if you are more comfortable using a different distribution, such as Ubuntu or CentOS, this guide should still work (on CentOS, replace apt commands with yum). 135 | 136 | ### Enable WSL 137 | Enable Windows Subsystem for Linux by going to **Turn Windows features on or off** in the Control Panel (or search for it). Select the [x] Checkbox beside `Windows Subsystem for Linux`, and click OK. You will likely need to restart your computer to fully enable this feature. 138 | ### Store Package 139 | Go to the Windows Store and get the **Debian** package, or click [here](https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6#activetab=pivot:overviewtab). 140 | ### Open Debian 141 | From the start menu, type 'debian' to open the Debian console, or type 'debian' in Command Manager. 142 | 143 | ## 2. (WSL) Install & Setup Dependencies 144 | After setting up Debian, run the following commands: 145 | 146 | ### Install Dependencies 147 | ```bash 148 | $ apt update 149 | $ apt install -y curl git default-jdk 150 | ``` 151 | ### Configure Git 152 | If you use GitHub/GitLab you should make your user.email the primary email of that account. 153 | ```bash 154 | $ git config --global user.name "YOUR NAME" 155 | $ git config --global user.email your@email.com 156 | ``` 157 | 158 | ## 3. Cloning MyAirplaneFork 159 | You should now fork this repository. Ensure you run this inside WSL, not any other terminal. 160 | ```bash 161 | $ cd ~ # Optional, takes you to your home directory 162 | $ git clone https://github.com/TECHNOVE/MyAirplaneFork.git my-fork-directory 163 | ``` 164 | 165 | Once the repository has finished downloading, enter it. 166 | ```bash 167 | $ cd my-fork-directory 168 | ``` 169 | 170 | ## 3. Apply the patches 171 | Apply the default patches. This will download the Minecraft server, decompile and de-obfuscate the code using the mappings (automatically provided), then apply the various patches from Airplane, Tuinity, Paper, Spigot and Bukkit/CraftBukkit. 172 | 173 | This is quite an intensive operation, and can take several minutes (up to 30 in some cases) to fully apply. 174 | 175 | ```bash 176 | $ ./gradlew applyPatches 177 | ``` 178 | 179 | ## 4. Done! 180 | You should now have a complete version of Airplane, forked and ready to go on your codebase. 181 | 182 | ### Patching with IntelliJ IDEA 183 | If using IntelliJ IDEA, you should be running at least **2021.1** to have full Windows Subsystem for Linux support. If you followed the guide verbatim, your code will be at `\\wsl$\Debian\home\\my-fork-directory`. 184 | 185 | IntelliJ IDEA 2021.1 added support natively for WSL projects - without this version, the Gradle sidebar and potential indexing may fail. 186 | 187 | 188 | ## Questions? 189 | 190 | If you need help with any of this or run into issues, feel free to ask questions in the Airplane Discord located here: https://discord.gg/3gtc45q 191 | 192 | 193 | ## Additional Info 194 | 195 | ### Using an IDE 196 | 197 | I personally recommend IntelliJ as my IDE of choice, but there's one thing you have to make sure not to do. 198 | Our build system is [Toothpick](https://github.com/jpenilla/Toothpick), put together by the amazing [Purpur](https://github.com/pl3xgaming/Purpur) team. 199 | Unlike other forks, this system uses Gradle instead of Maven. 200 | Inside the Server folder however, you will still find a `pom.xml` that IntelliJ may try to import. If it does, make sure to unlink the Maven project and doublecheck that the Gradle project is imported 201 | 202 | ### Changing Branding 203 | 204 | This won't be a comprehensive guide, but if you need to change branding you should go to these places: 205 | 206 | - build.gradle.kts (forkName, groupId, forkUrl, paperclipName) 207 | - settings.gradle.kts (forkName) 208 | - MyAirplaneFork-Server/pom.xml (API dependency) 209 | - PaperVersionFinder.java (change GitHub repo) 210 | - MinecraftServer.java (getServerModName) 211 | - CraftServer.java (serverName) 212 | - Versioning.java (path to pom.properties should match API) 213 | 214 | ### Licensing 215 | 216 | This repository is licensed under MIT, however I'm fairly convinced due to the GPL licensing of upstreams that forks need to be licensed GPL as well. 217 | 218 | --------------------------------------------------------------------------------