From 4263fd08759645e8150c1ce2ca95db03469c7246 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Thu, 29 Jun 2023 17:33:36 +0200 Subject: [PATCH] Configures api version injection --- UltimateStackerAPI/pom.xml | 24 +++++++++++++++++++ .../api/UltimateStackerAPI.java | 12 ++++++++++ 2 files changed, 36 insertions(+) diff --git a/UltimateStackerAPI/pom.xml b/UltimateStackerAPI/pom.xml index 13a6e7b..0dd258a 100644 --- a/UltimateStackerAPI/pom.xml +++ b/UltimateStackerAPI/pom.xml @@ -26,6 +26,30 @@ ${java.release} + + de.m3y.maven + inject-maven-plugin + 1.3 + + + + process-classes + + + inject + + + + + + + + ${project.version} + com.craftaro.ultimatestacker.api.UltimateStackerAPI.getVersion + + + + diff --git a/UltimateStackerAPI/src/main/java/com/craftaro/ultimatestacker/api/UltimateStackerAPI.java b/UltimateStackerAPI/src/main/java/com/craftaro/ultimatestacker/api/UltimateStackerAPI.java index 100e2b4..7105d6d 100644 --- a/UltimateStackerAPI/src/main/java/com/craftaro/ultimatestacker/api/UltimateStackerAPI.java +++ b/UltimateStackerAPI/src/main/java/com/craftaro/ultimatestacker/api/UltimateStackerAPI.java @@ -7,6 +7,11 @@ import com.craftaro.ultimatestacker.api.stack.spawner.SpawnerStackManager; import com.craftaro.core.hooks.stackers.UltimateStacker; import org.bukkit.plugin.Plugin; +/** + * The main class of the API + *

+ * !! {@link UltimateStackerAPI#getVersion()} value is automatically replaced by maven don't change it !! + */ public final class UltimateStackerAPI { private static Plugin plugin; @@ -82,4 +87,11 @@ public final class UltimateStackerAPI { return settings; } + /** + * Used to get the version of the plugin + * @return The version of the plugin + */ + public static String getVersion() { + return "UKNOWN_VERSION"; + } }