From 03c07cad112ce553dd1a8cb164e3a8cf09f5313c Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Tue, 19 Dec 2017 14:20:09 +0000 Subject: [PATCH 01/10] Mavenize the project and add more to plugin.yml --- .gitignore | 174 ++++++++++++++++++ pom.xml | 34 ++++ .../exampleplugin}/BroadcastPluginTask.java | 6 +- .../nukkit/exampleplugin}/EventListener.java | 6 +- .../nukkit/exampleplugin/ExamplePlugin.java} | 6 +- src/main/resources/plugin.yml | 24 ++- 6 files changed, 237 insertions(+), 13 deletions(-) create mode 100644 .gitignore create mode 100644 pom.xml rename src/main/java/{ExamplePlugin => cn/nukkit/exampleplugin}/BroadcastPluginTask.java (63%) rename src/main/java/{ExamplePlugin => cn/nukkit/exampleplugin}/EventListener.java (83%) rename src/main/java/{ExamplePlugin/MainClass.java => cn/nukkit/exampleplugin/ExamplePlugin.java} (94%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4d1d4e --- /dev/null +++ b/.gitignore @@ -0,0 +1,174 @@ +# Created by https://www.gitignore.io/api/java,maven,intellij,intellij+iml,intellij+all + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Intellij+all ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: + +# Sensitive or high-churn files: + +# Gradle: + +# CMake + +# Mongo Explorer plugin: + +## File-based project format: + +## Plugin-specific files: + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +### Intellij+all Patch ### +# Ignores the whole idea folder +# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 + +.idea/ + +### Intellij+iml ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: + +# Sensitive or high-churn files: + +# Gradle: + +# CMake + +# Mongo Explorer plugin: + +## File-based project format: + +## Plugin-specific files: + +# IntelliJ + +# mpeltonen/sbt-idea plugin + +# JIRA plugin + +# Cursive Clojure plugin + +# Crashlytics plugin (for Android Studio and IntelliJ) + +### Intellij+iml Patch ### +# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 + +*.iml +modules.xml +.idea/misc.xml +*.ipr + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# Manifest files +*.MF + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +# Avoid ignoring Maven wrapper jar file (.jar files are usually ignored) +!/.mvn/wrapper/maven-wrapper.jar \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..6cfb4f4 --- /dev/null +++ b/pom.xml @@ -0,0 +1,34 @@ + + + 4.0.0 + + cn.nukkit + example-plugin + 1.0.0 + ExamplePlugin + An Example Nukkit Plugin + https://github.com/NukkitX/ExamplePlugin/ + + + UTF-8 + 1.8 + 1.8 + + + + + potestas-repo + http://repo.potestas.xyz/ + + + + + + cn.nukkit + nukkit + 1.0-SNAPSHOT + provided + + + \ No newline at end of file diff --git a/src/main/java/ExamplePlugin/BroadcastPluginTask.java b/src/main/java/cn/nukkit/exampleplugin/BroadcastPluginTask.java similarity index 63% rename from src/main/java/ExamplePlugin/BroadcastPluginTask.java rename to src/main/java/cn/nukkit/exampleplugin/BroadcastPluginTask.java index e26aa88..d2cf517 100644 --- a/src/main/java/ExamplePlugin/BroadcastPluginTask.java +++ b/src/main/java/cn/nukkit/exampleplugin/BroadcastPluginTask.java @@ -1,4 +1,4 @@ -package ExamplePlugin; +package cn.nukkit.exampleplugin; import cn.nukkit.scheduler.PluginTask; @@ -6,9 +6,9 @@ * author: MagicDroidX * ExamplePlugin Project */ -public class BroadcastPluginTask extends PluginTask { +public class BroadcastPluginTask extends PluginTask { - public BroadcastPluginTask(MainClass owner) { + public BroadcastPluginTask(ExamplePlugin owner) { super(owner); } diff --git a/src/main/java/ExamplePlugin/EventListener.java b/src/main/java/cn/nukkit/exampleplugin/EventListener.java similarity index 83% rename from src/main/java/ExamplePlugin/EventListener.java rename to src/main/java/cn/nukkit/exampleplugin/EventListener.java index 309f229..18c18d7 100644 --- a/src/main/java/ExamplePlugin/EventListener.java +++ b/src/main/java/cn/nukkit/exampleplugin/EventListener.java @@ -1,4 +1,4 @@ -package ExamplePlugin; +package cn.nukkit.exampleplugin; import cn.nukkit.event.EventHandler; import cn.nukkit.event.EventPriority; @@ -10,9 +10,9 @@ * NukkitExamplePlugin Project */ public class EventListener implements Listener { - MainClass plugin; + private final ExamplePlugin plugin; - public EventListener(MainClass plugin) { + public EventListener(ExamplePlugin plugin) { this.plugin = plugin; } diff --git a/src/main/java/ExamplePlugin/MainClass.java b/src/main/java/cn/nukkit/exampleplugin/ExamplePlugin.java similarity index 94% rename from src/main/java/ExamplePlugin/MainClass.java rename to src/main/java/cn/nukkit/exampleplugin/ExamplePlugin.java index 1aaf0a2..0a34b9b 100644 --- a/src/main/java/ExamplePlugin/MainClass.java +++ b/src/main/java/cn/nukkit/exampleplugin/ExamplePlugin.java @@ -1,4 +1,4 @@ -package ExamplePlugin; +package cn.nukkit.exampleplugin; import cn.nukkit.command.Command; import cn.nukkit.command.CommandSender; @@ -15,7 +15,7 @@ * author: MagicDroidX * NukkitExamplePlugin Project */ -public class MainClass extends PluginBase { +public class ExamplePlugin extends PluginBase { @Override public void onLoad() { @@ -61,7 +61,7 @@ public void onDisable() { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - switch (command.getName()) { + switch (command.getName().toLowerCase()) { case "example": try { this.getLogger().info(Utils.readFile(new File(this.getDataFolder(), "string.txt")) + " " + sender.getName()); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8230d1d..04b4c32 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,20 +1,36 @@ #name, main, version and api are required name: ExamplePlugin -main: ExamplePlugin.MainClass +main: cn.nukkit.exampleplugin.ExamplePlugin #remember version and api is string, don't write it like this: 1.0.0, or there will be an exception version: "1.0.0" api: ["1.0.0"] - load: POSTWORLD author: Nukkit Project +# Authors and author will be added together in one list. +authors: ["Example", "Another"] description: Example plugin showing the API -website: https://github.com/Nukkit/ExamplePlugin +website: https://github.com/NukkitX/ExamplePlugin +# These dependencies are required for the plugin to start. +depend: ["OtherPlugin", "ThisPlugin"] +# These dependencies are not required. +softdepend: ["PluginA", "PluginB"] +# Log prefix in console +prefix: "Example" +# Plugin will be loaded before these. Any cyclic loadbefore's or dependencies's will throw errors! +loadbefore: ["ImportantPlugin"] + commands: example: description: Example command usage: "/example" + aliases: ["xample", "nukkitexample"] permission: exampleplugin.command.example + permission-message: "You do not have the required permission to run /example" permissions: exampleplugin.command.example: description: "Allows the user to run the example command" - default: true \ No newline at end of file + default: true + children: +# exampleplugin.command.example.test: +# description: "Use the test feature in the example command" +# default: true \ No newline at end of file From da0cc963da87ae4bb30c175890e77d8a5c77e3c8 Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Tue, 19 Dec 2017 14:22:12 +0000 Subject: [PATCH 02/10] Fix indentation --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 6cfb4f4..3cf784f 100644 --- a/pom.xml +++ b/pom.xml @@ -2,27 +2,27 @@ 4.0.0 - + cn.nukkit example-plugin 1.0.0 ExamplePlugin An Example Nukkit Plugin - https://github.com/NukkitX/ExamplePlugin/ - + https://github.com/NukkitX/ExamplePlugin/ + UTF-8 1.8 1.8 - + potestas-repo http://repo.potestas.xyz/ - + cn.nukkit From f364092c5edca50c2c6efeb1e97323f235cbc24d Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Fri, 22 Dec 2017 13:40:58 +0000 Subject: [PATCH 03/10] Give pom default goal --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3cf784f..4d3bb48 100644 --- a/pom.xml +++ b/pom.xml @@ -31,4 +31,8 @@ provided - \ No newline at end of file + + + clean package + + From 3c7b9d2d116aa42a9b458be267acd22dd1124427 Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Mon, 5 Feb 2018 19:35:49 +0000 Subject: [PATCH 04/10] Update maven repo --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d3bb48..ddaad98 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ potestas-repo - http://repo.potestas.xyz/ + http://repo.potestas.xyz/main/ From a5a1f33b67707a759fe3cc76dbd43131d1036d09 Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Wed, 14 Feb 2018 16:49:03 +0000 Subject: [PATCH 05/10] Update API version --- src/main/resources/plugin.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 04b4c32..c94dd3f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -3,7 +3,7 @@ name: ExamplePlugin main: cn.nukkit.exampleplugin.ExamplePlugin #remember version and api is string, don't write it like this: 1.0.0, or there will be an exception version: "1.0.0" -api: ["1.0.0"] +api: ["1.0.5"] load: POSTWORLD author: Nukkit Project # Authors and author will be added together in one list. @@ -11,7 +11,7 @@ authors: ["Example", "Another"] description: Example plugin showing the API website: https://github.com/NukkitX/ExamplePlugin # These dependencies are required for the plugin to start. -depend: ["OtherPlugin", "ThisPlugin"] +#depend: ["OtherPlugin", "ThisPlugin"] # These dependencies are not required. softdepend: ["PluginA", "PluginB"] # Log prefix in console @@ -33,4 +33,4 @@ permissions: children: # exampleplugin.command.example.test: # description: "Use the test feature in the example command" -# default: true \ No newline at end of file +# default: true From c768789fceb0446226fa47db35b57573e2f6581e Mon Sep 17 00:00:00 2001 From: SupremeMortal Date: Sun, 6 May 2018 14:20:37 +0100 Subject: [PATCH 06/10] Update repo --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index ddaad98..9f9433b 100644 --- a/pom.xml +++ b/pom.xml @@ -18,8 +18,8 @@ - potestas-repo - http://repo.potestas.xyz/main/ + nukkitx-repo + http://repo.nukkitx.com/main/ From a2f396b05479800dcb44caf9fe68ef56293199e3 Mon Sep 17 00:00:00 2001 From: Wode <17339354+wode490390@users.noreply.github.com> Date: Sat, 25 May 2019 20:23:41 +0800 Subject: [PATCH 07/10] Update plugin.yml (#2) --- src/main/resources/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c94dd3f..0153b4d 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -30,7 +30,7 @@ permissions: exampleplugin.command.example: description: "Allows the user to run the example command" default: true - children: +# children: # exampleplugin.command.example.test: # description: "Use the test feature in the example command" # default: true From 6e7ae0f1bd5c98349b9700bb526591c5ed8d6d3f Mon Sep 17 00:00:00 2001 From: SupremeMortal <6178101+SupremeMortal@users.noreply.github.com> Date: Tue, 11 Feb 2020 20:51:10 +0000 Subject: [PATCH 08/10] Use new repository --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9f9433b..c9d8ee1 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ nukkitx-repo - http://repo.nukkitx.com/main/ + http://repo.nukkitx.com/maven-snapshots/ From c0f068c3491f1590c56397edce0667f7c0ef10df Mon Sep 17 00:00:00 2001 From: Owen Date: Fri, 19 May 2023 22:31:10 +0100 Subject: [PATCH 09/10] Update URLs --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c9d8ee1..6a62bc8 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ 1.0.0 ExamplePlugin An Example Nukkit Plugin - https://github.com/NukkitX/ExamplePlugin/ + https://github.com/CloudburstMC/ExamplePlugin/ UTF-8 @@ -19,7 +19,7 @@ nukkitx-repo - http://repo.nukkitx.com/maven-snapshots/ + http://repo.opencollab.dev/maven-snapshots/ From c186092e724c9b5c211def0899b67226c02a48fc Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 7 Sep 2023 11:42:48 +0100 Subject: [PATCH 10/10] Use HTTPS for maven repository --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a62bc8..5828f30 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ nukkitx-repo - http://repo.opencollab.dev/maven-snapshots/ + https://repo.opencollab.dev/maven-snapshots/