From 39a3c8380124065f8e2cc6d3cc5f95e154fb3170 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 22 Jul 2021 22:11:43 +0200 Subject: [PATCH] The CLI is not a plugin... but now it technically is? --- worldedit-cli/build.gradle.kts | 23 ++++++++++++++++++- .../com/sk89q/worldedit/cli/AccessPoint.java | 8 +++++++ .../com/sk89q/worldedit/cli/package-info.java | 6 +++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 worldedit-cli/src/main/java/com/sk89q/worldedit/cli/AccessPoint.java create mode 100644 worldedit-cli/src/main/java/com/sk89q/worldedit/cli/package-info.java diff --git a/worldedit-cli/build.gradle.kts b/worldedit-cli/build.gradle.kts index fd57158a9..0e1fc3947 100644 --- a/worldedit-cli/build.gradle.kts +++ b/worldedit-cli/build.gradle.kts @@ -1,7 +1,9 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import net.minecrell.pluginyml.bukkit.BukkitPluginDescription plugins { `java-library` + id("net.minecrell.plugin-yml.bukkit") version "0.4.0" } project.description = "CLI" @@ -30,7 +32,7 @@ tasks.named("shadowJar") { dependencies { include { true } } - archiveFileName.set("${rootProject.name}-${project.description}-${project.version}.${archiveExtension.getOrElse("jar")}") + archiveFileName.set(moduleIdentifier) minimize { exclude(dependency("org.apache.logging.log4j:log4j-core")) } @@ -39,3 +41,22 @@ tasks.named("shadowJar") { tasks.named("assemble").configure { dependsOn("shadowJar") } + +val moduleIdentifier = "${rootProject.name}-${project.description}-${project.version}.jar" +val decoration = "\n****************************************" +val websiteURL = "https://www.spigotmc.org/resources/13932/" + +bukkit { + name = "FastAsyncWorldEdit-COMMAND_LINE_INTERFACE_NOT_A_PLUGIN" + main = "com.sk89q.worldedit.cli.AccessPoint" + apiVersion = decoration + + "\n* 404 - Plugin Not Found.\n" + + "* You installed the command line interface (CLI) which is not a plugin.\n" + + "* Stop your server, delete `$moduleIdentifier`" + + " and download the proper one from:\n" + + "* $websiteURL\n" + + "* (contains `-Bukkit-` instead of `-CLI-` in the name ;)" + + decoration + version = rootProject.version.toString() + website = websiteURL +} diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/AccessPoint.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/AccessPoint.java new file mode 100644 index 000000000..bdf99b6ef --- /dev/null +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/AccessPoint.java @@ -0,0 +1,8 @@ +package com.sk89q.worldedit.cli; + +/** + * This is a dummy class doing nothing but being + * annoying, if you try to use the CLI as plugin. + */ +public class AccessPoint { +} diff --git a/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/package-info.java b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/package-info.java new file mode 100644 index 000000000..11ccf05d1 --- /dev/null +++ b/worldedit-cli/src/main/java/com/sk89q/worldedit/cli/package-info.java @@ -0,0 +1,6 @@ +/** + * The following classes are FAWE additions: + * + * @see com.sk89q.worldedit.cli.AccessPoint + */ +package com.sk89q.worldedit.cli;