Configures api version injection

This commit is contained in:
ceze88 2023-06-29 17:33:36 +02:00
parent de3bd3b8c8
commit 4263fd0875
2 changed files with 36 additions and 0 deletions

View File

@ -26,6 +26,30 @@
<release>${java.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>de.m3y.maven</groupId>
<artifactId>inject-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>inject</goal>
</goals>
</execution>
</executions>
<configuration>
<injections>
<injection>
<value>${project.version}</value>
<pointCut>com.craftaro.ultimatestacker.api.UltimateStackerAPI.getVersion</pointCut>
</injection>
</injections>
</configuration>
</plugin>
</plugins>
</build>

View File

@ -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
* <p>
* <b>!! {@link UltimateStackerAPI#getVersion()} value is automatically replaced by maven don't change it !!</b>
*/
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";
}
}