From 42d4b4a7c1f03d780bccf3f032585518463e1de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tofik=20=E2=99=A1?= Date: Sun, 4 Jul 2021 23:10:39 +0200 Subject: [PATCH 1/2] 1.17 --- .gitignore | 4 +- .gitmodules | 3 - Airplane | 1 - README.md | 59 +++------ build-data/dev-imports.txt | 12 ++ build.gradle.kts | 95 +++++++++----- gradle.properties | 12 +- gradle/wrapper/gradle-wrapper.properties | 2 +- patches/api/.gitkeep | 0 patches/server/.gitkeep | 0 patches/server/0001-Build-changes.patch | 119 ++++++++++++++++++ .../server/0001-MyAirplaneFork-branding.patch | 75 ----------- settings.gradle.kts | 17 +-- subprojects/api.gradle.kts | 9 -- subprojects/server.gradle.kts | 5 - 15 files changed, 232 insertions(+), 181 deletions(-) delete mode 100644 .gitmodules delete mode 160000 Airplane create mode 100644 build-data/dev-imports.txt delete mode 100644 patches/api/.gitkeep delete mode 100644 patches/server/.gitkeep create mode 100644 patches/server/0001-Build-changes.patch delete mode 100644 patches/server/0001-MyAirplaneFork-branding.patch delete mode 100644 subprojects/api.gradle.kts delete mode 100644 subprojects/server.gradle.kts diff --git a/.gitignore b/.gitignore index 8ad1ef9..7b11959 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,7 @@ MyAirplaneFork-API MyAirplaneFork-Server -last-airplane build/ .gradle/ -launcher-*.jar -mcdevimports.json +*.jar diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index fd73a00..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "Airplane"] - path = Airplane - url = https://github.com/Technove/Airplane.git diff --git a/Airplane b/Airplane deleted file mode 160000 index 4144b28..0000000 --- a/Airplane +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4144b28e228b12c9a477cd7695b3fd1ca6b4049b diff --git a/README.md b/README.md index 5853b44..4aeb6d9 100644 --- a/README.md +++ b/README.md @@ -8,14 +8,14 @@ Fork this repository to your own repo, then clone it locally. Once you've cloned ```bash cd MyAirplaneFork ./gradlew applyPatches -# or on windows (STRONGLY DISCOURAGED - see below) -gradlew.bat applyPatches +# or on windows +gradlew applyPatches ``` This will set up the entire project, as once it's done everything will be ready to go! ### Windows -Using Windows? Click [here](#step-by-step-guide-for-windows-using-wsl) to view the Windows Guide. +Using Windows? Click [here](#step-by-step-guide-for-windows-using-wsl) to view the Windows Guide to install WSL (not required). ## Working on the fork @@ -42,7 +42,7 @@ So if you want to create a new patch, just add a commit to either the API or Ser ```bash ./gradlew rebuildPatches # or on windows -gradlew.bat rebuildPatches +gradlew rebuildPatches ``` This command takes your commits, and turns them back into the actual patch files that you push. @@ -50,12 +50,7 @@ You should make sure that your fork never has the API and Server folders pushed, ## How do I update the upstream? -This step is fairly easy, assuming there's no merge errors. To update the upstream (Airplane), all you have to do is run: - -```bash -./gradlew updateUpstream -# or on windows -gradlew.bat updateUpstream +This step is fairly easy, assuming there's no merge errors. To update the upstream (Airplane), all you have to do is change the `AirplaneCommit` in `gradle.properties` ``` Then to rebuild the API & Server folders with your patches, just reapply them: @@ -63,7 +58,7 @@ Then to rebuild the API & Server folders with your patches, just reapply them: ```bash ./gradlew applyPatches # or on windows -gradlew.bat applyPatches +gradlew applyPatches ``` 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. @@ -81,7 +76,7 @@ Once all your patches apply successfully, all you have to do is make sure you're ```bash ./gradlew rebuildPatches # or on windows -gradlew.bat rebuildPatches +gradlew rebuildPatches ``` Finally, you have two options for making the commit: @@ -91,16 +86,6 @@ git add --all git commit -m 'Description of my changes' ``` -Or if you want a fancy commit message that lists the upstream changes, you can just run - -```bash -git add --all - -./gradlew upstreamCommit -# or on windows -gradlew.bat upstreamCommit -``` - With that, you've successfully updated your fork! ## Building the fork @@ -110,20 +95,20 @@ If you're just building the fork to test, you can run: ```bash ./gradlew build # or on windows -gradlew.bat build +gradlew build ``` -Which will output your final JAR at `MyAirplaneFork-Server/build/libs/myairplanefork-server-1.16.5-R0.1-SNAPSHOT.jar`. +Which will output your final JAR at `MyAirplaneFork-Server/build/libs/MyAirplaneFork-Server-reobf.jar`. However, you should not distribute this JAR outside testing because it contains Mojang's copyrighted Minecraft code. 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: ```bash -./gradlew paperclip +./gradlew paperclipJar # or on windows -gradle.bat paperclip +gradlew paperclipJar ``` -This will output your distributable JAR at `launcher-myairplanefork.jar`, right in your main directory! +This will output your distributable JAR at `myairplanefork-paperclip.jar`, right in your main directory! # Step-by-Step Guide for Windows using WSL 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. @@ -149,6 +134,7 @@ $ apt install -y curl git default-jdk ### Configure Git If you use GitHub/GitLab you should make your user.email the primary email of that account. ```bash +$ git config --global core.longpaths true (only if youre using windows without wsl) $ git config --global user.name "YOUR NAME" $ git config --global user.email your@email.com ``` @@ -172,6 +158,8 @@ This is quite an intensive operation, and can take several minutes (up to 30 in ```bash $ ./gradlew applyPatches +# or on windows +gradlew applyPatches ``` ## 4. Done! @@ -187,23 +175,14 @@ IntelliJ IDEA 2021.1 added support natively for WSL projects - without this vers 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 - -## Additional Info - -### Using an IDE - -I personally recommend IntelliJ as my IDE of choice, but there's one thing you have to make sure not to do. -Our build system is [Toothpick](https://github.com/jpenilla/Toothpick), put together by the amazing [Purpur](https://github.com/pl3xgaming/Purpur) team. -Unlike other forks, this system uses Gradle instead of Maven. -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 - ### Changing Branding This won't be a comprehensive guide, but if you need to change branding you should go to these places: -- build.gradle.kts (forkName, groupId, forkUrl, paperclipName) -- settings.gradle.kts (forkName) -- MyAirplaneFork-Server/pom.xml (API dependency) +- build.gradle.kts (archiveFileName.set, apiOutputDir.set, serverOutputDir.set, serverProject.set) +- settings.gradle.kts (rootProject.name , include) +- gradle.properties (group) +- MyAirplaneFork-Server/build.gradle.kts (API dependency) - PaperVersionFinder.java (change GitHub repo) - MinecraftServer.java (getServerModName) - CraftServer.java (serverName) diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt new file mode 100644 index 0000000..f671e12 --- /dev/null +++ b/build-data/dev-imports.txt @@ -0,0 +1,12 @@ +# You can use this file to import files from vanilla into the project +# both fully qualified and a file based syntax are accepted here: +# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter +# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java +# +# You can use this file to import files from minecraft libraries into the project +# format: +# +# both fully qualified and a file based syntax are accepted for : +# authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +# datafixerupper com.mojang.datafixers.DataFixerBuilder +# datafixerupper com/mojang/datafixers/util/Either.java \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 7c83df9..9243db6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,47 +1,82 @@ +import io.papermc.paperweight.util.Constants + plugins { - `java-library` - id("xyz.jpenilla.toothpick") + java + id("com.github.johnrengelman.shadow") version "7.0.0" apply false + id("io.papermc.paperweight.patcher") version "1.1.6" } -toothpick { - forkName = "MyAirplaneFork" - groupId = "com.mygroupid" - val versionTag = System.getenv("BUILD_NUMBER") - ?: "\"${commitHash() ?: error("Could not obtain git hash")}\"" - forkVersion = "git-$forkName-$versionTag" - forkUrl = "https://github.com/MyName/MyAirplaneFork" +repositories { + mavenCentral() + maven("https://papermc.io/repo/repository/maven-public/") { + content { onlyForConfigurations(Constants.PAPERCLIP_CONFIG) } + } + maven("https://maven.quiltmc.org/repository/release/") { + content { onlyForConfigurations(Constants.REMAPPER_CONFIG) } + } +} - minecraftVersion = "1.16.5" - nmsPackage = "1_16_R3" - nmsRevision = "R0.1-SNAPSHOT" +dependencies { + remapper("org.quiltmc:tiny-remapper:0.4.1") + paperclip("io.papermc:paperclip:2.0.1") +} - upstream = "Airplane" - upstreamBranch = "origin/master" +subprojects { + apply(plugin = "java") + apply(plugin = "maven-publish") - paperclipName = "launcher-myairplanefork" + java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(16)) + } + } - server { - project = project(":$forkNameLowercase-server") - patchesDir = file("patches/server") + tasks.withType { + options.encoding = Charsets.UTF_8.name() + options.release.set(16) } - api { - project = project(":$forkNameLowercase-api") - patchesDir = file("patches/api") + tasks.withType { + options.encoding = Charsets.UTF_8.name() } -} -subprojects { repositories { mavenCentral() - maven("https://repo.aikar.co/content/groups/aikar/") - maven("https://nexus.velocitypowered.com/repository/velocity-artifacts-snapshots/") - maven("https://libraries.minecraft.net") + maven("https://libraries.minecraft.net/") + maven("https://repo.codemc.io/repository/maven-public/") + maven("https://oss.sonatype.org/content/groups/public/") + maven("https://papermc.io/repo/repository/maven-public/") + maven("https://ci.emc.gs/nexus/content/groups/aikar/") + maven("https://repo.aikar.co/content/groups/aikar") + maven("https://repo.md-5.net/content/repositories/releases/") + maven("https://hub.spigotmc.org/nexus/content/groups/public/") maven("https://jitpack.io") - mavenLocal() } + configure { + repositories.maven { + name = "maven" + url = uri("https://my_mvn_repo.org/repository/maven-snapshots/") + credentials(PasswordCredentials::class) + } + } +} - java { - sourceCompatibility = JavaVersion.toVersion(8) - targetCompatibility = JavaVersion.toVersion(8) +paperweight { + serverProject.set(project(":MyAirplaneFork-Server")) + + useStandardUpstream("Airplane") { + url.set(github("TECHNOVE", "Airplane")) + ref.set(providers.gradleProperty("AirplaneCommit")) + + withStandardPatcher { + baseName("Airplane") + + apiOutputDir.set(layout.projectDirectory.dir("MyAirplaneFork-API")) + serverOutputDir.set(layout.projectDirectory.dir("MyAirplaneFork-Server")) + } } } + +tasks.paperclipJar { + destinationDirectory.set(rootProject.layout.projectDirectory) + archiveFileName.set("myairplanefork-paperclip.jar") +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index a5950be..a8dd459 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,12 @@ +group = com.myairplanefork +version = 1.17-R0.1-SNAPSHOT + +AirplaneCommit = 61758c077303194cb59aea19b111eb48d25d8a11 + org.gradle.daemon=true -org.gradle.jvmargs=-Xmx2G +org.gradle.jvmargs=-Xms1G -Xmx4G +org.gradle.parallel=true +kotlin.parallel.tasks.in.project=true +org.gradle.caching=true +org.gradle.configureondemand=true +org.gradle.vfs.watch=false \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f80bbf..05679dc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/patches/api/.gitkeep b/patches/api/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/patches/server/.gitkeep b/patches/server/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/patches/server/0001-Build-changes.patch b/patches/server/0001-Build-changes.patch new file mode 100644 index 0000000..00dfc08 --- /dev/null +++ b/patches/server/0001-Build-changes.patch @@ -0,0 +1,119 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MyAirplaneFork +Date: Wed, 3 Feb 2021 23:02:38 -0600 +Subject: [PATCH] Build changes + + +diff --git a/build.gradle.kts b/build.gradle.kts +index 6b3f922bc4b9f8045bf9b41cc922afd3496dd4df..4758bb22e3af29c218adb40d8418f2df0b49b966 100644 +--- a/build.gradle.kts ++++ b/build.gradle.kts +@@ -36,7 +36,7 @@ repositories { + } + + dependencies { +- implementation(project(":Airplane-API")) // Airplane // Tuinity ++ implementation(project(":MyAirplaneFork-API")) // MyAirplaneFork // Airplane // Tuinity + implementation("com.destroystokyo.paper:paper-mojangapi:1.16.5-R0.1-SNAPSHOT") // Tuinity + // Paper start + implementation("org.jline:jline-terminal-jansi:3.12.1") +@@ -91,7 +91,7 @@ tasks.jar { + attributes( + "Main-Class" to "org.bukkit.craftbukkit.Main", + "Implementation-Title" to "CraftBukkit", +- "Implementation-Version" to "git-Airplane-$implementationVersion", // Airplane // Tuinity ++ "Implementation-Version" to "git-MyAirplaneFork-$implementationVersion", // MyAirplaneFork // Airplane // Tuinity + "Implementation-Vendor" to SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(Date()), // Paper + "Specification-Title" to "Bukkit", + "Specification-Version" to project.version, +diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java +index f5d01bce4d5547b4aeca96b7962b2090f47ea541..af541048f48b06b844bb2a426af577165239ddc9 100644 +--- a/src/main/java/com/destroystokyo/paper/Metrics.java ++++ b/src/main/java/com/destroystokyo/paper/Metrics.java +@@ -593,7 +593,7 @@ public class Metrics { + boolean logFailedRequests = config.getBoolean("logFailedRequests", false); + // Only start Metrics, if it's enabled in the config + if (config.getBoolean("enabled", true)) { +- Metrics metrics = new Metrics("Airplane", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane ++ Metrics metrics = new Metrics("MyAirplaneFork", serverUUID, logFailedRequests, Bukkit.getLogger()); // Tuinity - we have our own bstats page // Airplane // MyAirplaneFork + + metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> { + String minecraftVersion = Bukkit.getVersion(); +@@ -602,8 +602,8 @@ public class Metrics { + })); + + metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size())); +- metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : "offline")); +- metrics.addCustomChart(new Metrics.SimplePie("airplane_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane ++ metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (PaperConfig.isProxyOnlineMode() ? "bungee" : "offline"))); // Sugarcane ++ metrics.addCustomChart(new Metrics.SimplePie("myairplanefork_version", () -> (Metrics.class.getPackage().getImplementationVersion() != null) ? Metrics.class.getPackage().getImplementationVersion() : "unknown")); // Tuinity - we have our own bstats page // Airplane // MyAirplaneFork + + metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> { + Map> map = new HashMap<>(); +diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +index 5460f57f0473868b3fb09c526a1767f717a2740e..3072ae4ab8fff7e53d1ff8b56fe762d14e3baea8 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java ++++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +@@ -29,8 +29,8 @@ public class PaperVersionFetcher implements VersionFetcher { + @Nonnull + @Override + public Component getVersionMessage(@Nonnull String serverVersion) { +- String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Tuinity +- final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Tuinity ++ String[] parts = serverVersion.substring("git-MyAirplaneFork-".length()).split("[-\\s]"); // Tuinity // MyAirplaneFork ++ final Component updateMessage = getUpdateStatusMessage("MyGithubName/MyAirplaneFork", GITHUB_BRANCH_NAME, parts[0]); // Tuinity // MyAirplaneFork + final Component history = getHistory(); + + return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; +diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +index e0b1f0671d16ddddcb6725acd25a1d1d69e42701..17f2196ce6041e710fc3e4689dcfcbb7f7e41817 100644 +--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java ++++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java +@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole { + @Override + protected LineReader buildReader(LineReaderBuilder builder) { + builder +- .appName("Paper") ++ .appName("MyAirplaneFork") // MyAirplaneFork + .variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history")) + .completer(new ConsoleCommandCompleter(this.server)) + .option(LineReader.Option.COMPLETE_IN_WORD, true); +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 4696a6bb393f75a3915f6ecc2d36c22a77e0f907..cdd34283bde048e4143d2a5c467c491749c09c09 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1714,7 +1714,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop // Tuinity - Tuinity > //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! ++ return "MyAirplaneFork"; // MyAirplaneFork - MyAirplaneFork > // Airplane - Airplane > // Tuinity - Tuinity > //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! + } + + public SystemReport fillSystemReport(SystemReport systemreport) { +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index d8757cce8218490bf6b4b37a5a230be00f2e0c30..f33501fdd6ba10ac70423f55878f7c035e494cc7 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -230,7 +230,7 @@ import javax.annotation.Nullable; // Paper + import javax.annotation.Nonnull; // Paper + + public final class CraftServer implements Server { +- private final String serverName = "Airplane"; // Airplane // Tuinity // Paper ++ private final String serverName = "MyAirplaneFork"; // MyAirplaneFork // Airplane // Tuinity // Paper + private final String serverVersion; + private final String bukkitVersion = Versioning.getBukkitVersion(); + private final Logger logger = Logger.getLogger("Minecraft"); +diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +index 1788d79ea489e446d3d9f541693d4ba3dfc26015..f40a781a2bb8a7a1561e4458906ad1d8c63fb2f8 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +@@ -11,7 +11,7 @@ public final class Versioning { + public static String getBukkitVersion() { + String result = "Unknown-Version"; + +- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane ++ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.myairplanefork/myairplanefork-api/pom.properties"); // Tuinity // Airplane + Properties properties = new Properties(); + + if (stream != null) { diff --git a/patches/server/0001-MyAirplaneFork-branding.patch b/patches/server/0001-MyAirplaneFork-branding.patch deleted file mode 100644 index 906145f..0000000 --- a/patches/server/0001-MyAirplaneFork-branding.patch +++ /dev/null @@ -1,75 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Paul Sauve -Date: Wed, 3 Feb 2021 23:02:38 -0600 -Subject: [PATCH] MyAirplaneFork branding - - -diff --git a/pom.xml b/pom.xml -index efa2ea6b8422f900643eb2f0f65cf067c034cea3..1cd91deffb55e31f6a1f11af69b1fa3aa17abcf0 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -39,8 +39,8 @@ - - - -- gg.airplane -- airplane-api -+ com.mygroupid -+ myairplanefork-api - ${project.version} - compile - -diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 5460f57f0473868b3fb09c526a1767f717a2740e..3072ae4ab8fff7e53d1ff8b56fe762d14e3baea8 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -@@ -29,8 +29,8 @@ public class PaperVersionFetcher implements VersionFetcher { - @Nonnull - @Override - public Component getVersionMessage(@Nonnull String serverVersion) { -- String[] parts = serverVersion.substring("git-Airplane-".length()).split("[-\\s]"); // Tuinity -- final Component updateMessage = getUpdateStatusMessage("TECHNOVE/Airplane", GITHUB_BRANCH_NAME, parts[0]); // Tuinity -+ String[] parts = serverVersion.substring("git-MyAirplaneFork-".length()).split("[-\\s]"); // Tuinity // MyAirplaneFork -+ final Component updateMessage = getUpdateStatusMessage("MyGithubName/MyAirplaneFork", GITHUB_BRANCH_NAME, parts[0]); // Tuinity // MyAirplaneFork - final Component history = getHistory(); - - return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage; -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 26f423d3fdc958764758573043310f84da08a08e..0c013dd8e17e84e9c006d61bbc9d3ca830c1cd6c 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1650,7 +1650,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant // Spigot - Spigot > // CraftBukkit - cb > vanilla! -+ return "MyAirplaneFork"; // MyAirplaneFork // Airplane // Tuinity //Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla! - } - - public CrashReport b(CrashReport crashreport) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eab5bd32860d136864ca8f74be264236cf530910..6263352e543449fe1f62b7576f9b896e96caec4f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -230,7 +230,7 @@ import javax.annotation.Nullable; // Paper - import javax.annotation.Nonnull; // Paper - - public final class CraftServer implements Server { -- private final String serverName = "Airplane"; // Paper // Tuinity // Airplane -+ private final String serverName = "MyAirplaneFork"; // Paper // Tuinity // Airplane // MyAirplaneFork - private final String serverVersion; - private final String bukkitVersion = Versioning.getBukkitVersion(); - private final Logger logger = Logger.getLogger("Minecraft"); -diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 1788d79ea489e446d3d9f541693d4ba3dfc26015..0e18f778a434b8b22bb595f06cc6ef7833e64489 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -@@ -11,7 +11,7 @@ public final class Versioning { - public static String getBukkitVersion() { - String result = "Unknown-Version"; - -- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/gg.airplane/airplane-api/pom.properties"); // Tuinity // Airplane -+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/com.mygroupid/myairplanefork-api/pom.properties"); // Tuinity // Airplane - Properties properties = new Properties(); - - if (stream != null) { diff --git a/settings.gradle.kts b/settings.gradle.kts index a890a24..d53e7a5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,20 +1,11 @@ -import xyz.jpenilla.toothpick.setupToothpickProject -import java.util.Locale - -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") - pluginManagement { repositories { + mavenLocal() gradlePluginPortal() - mavenCentral() - maven("https://repo.jpenilla.xyz/snapshots") + maven("https://papermc.io/repo/repository/maven-public/") } } -plugins { - id("xyz.jpenilla.toothpick.settings") version "1.1.0-SNAPSHOT" -} +rootProject.name = "MyAirplaneFork" -val forkName = "MyAirplaneFork" -rootProject.name = forkName.toLowerCase(Locale.ROOT) -setupToothpickProject(rootProject, forkName) \ No newline at end of file +include("MyAirplaneFork-API", "MyAirplaneFork-Server") \ No newline at end of file diff --git a/subprojects/api.gradle.kts b/subprojects/api.gradle.kts deleted file mode 100644 index cf08da7..0000000 --- a/subprojects/api.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -repositories { -} - -dependencies { -} - -java { - withJavadocJar() -} diff --git a/subprojects/server.gradle.kts b/subprojects/server.gradle.kts deleted file mode 100644 index 0106858..0000000 --- a/subprojects/server.gradle.kts +++ /dev/null @@ -1,5 +0,0 @@ -repositories { -} - -dependencies { -} From 7175fd541465179651fdaf617f3fc45f3fe2f1a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tofik=20=E2=99=A1?= <62406295+Toffikk@users.noreply.github.com> Date: Thu, 15 Jul 2021 00:32:22 +0200 Subject: [PATCH 2/2] Update build.gradle.kts --- build.gradle.kts | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9243db6..28e5c03 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,24 +21,18 @@ dependencies { paperclip("io.papermc:paperclip:2.0.1") } -subprojects { +allprojects { apply(plugin = "java") apply(plugin = "maven-publish") - java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(16)) - } - } - - tasks.withType { - options.encoding = Charsets.UTF_8.name() - options.release.set(16) - } - tasks.withType { - options.encoding = Charsets.UTF_8.name() - } + java { toolchain { languageVersion.set(JavaLanguageVersion.of(16)) } } + tasks.withType { options.isFork = true; options.isIncremental = true; options.encoding = Charsets.UTF_8.name(); options.release.set(16) } + + tasks.withType { options.encoding = Charsets.UTF_8.name() } + + tasks.withType { filteringCharset = Charsets.UTF_8.name() } + repositories { mavenCentral() maven("https://libraries.minecraft.net/") @@ -79,4 +73,4 @@ paperweight { tasks.paperclipJar { destinationDirectory.set(rootProject.layout.projectDirectory) archiveFileName.set("myairplanefork-paperclip.jar") -} \ No newline at end of file +}