mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-13 10:44:03 +01:00
Add plugin lib version check
This commit is contained in:
parent
4d111eca9d
commit
509b93ce2e
@ -38,6 +38,12 @@
|
||||
<version>1.19.3-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>Minepacks-MagicValues</artifactId>
|
||||
<version>${version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -17,6 +17,10 @@
|
||||
|
||||
package at.pcgamingfreaks.Minepacks.Paper;
|
||||
|
||||
import at.pcgamingfreaks.Minepacks.MagicValues;
|
||||
import at.pcgamingfreaks.PCGF_PluginLibVersionDetection;
|
||||
import at.pcgamingfreaks.Version;
|
||||
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@ -78,21 +82,21 @@ private boolean patchPluginMeta(final @NotNull PluginProviderContext context)
|
||||
|
||||
private boolean checkPcgfPluginLib(final @NotNull PluginProviderContext context)
|
||||
{
|
||||
try
|
||||
String version = PCGF_PluginLibVersionDetection.getVersionBukkit();
|
||||
if (version != null)
|
||||
{
|
||||
Class.forName("at.pcgamingfreaks.PluginLib.Bukkit.PluginLib");
|
||||
//if (new Version(pcgfPluginLib.getDescription().getVersion()).olderThan(new Version(MagicValues.MIN_PCGF_PLUGIN_LIB_VERSION)))
|
||||
if (true) // TODO check version
|
||||
|
||||
if (new Version(version).olderThan(new Version(MagicValues.MIN_PCGF_PLUGIN_LIB_VERSION)))
|
||||
{
|
||||
context.getLogger().info("PCGF-PluginLib installed. Switching to normal mode!");
|
||||
context.getLogger().info("PCGF-PluginLib to old! Switching to standalone mode!");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
context.getLogger().info("PCGF-PluginLib to old! Switching to standalone mode!");
|
||||
context.getLogger().info("PCGF-PluginLib installed. Switching to normal mode!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
catch(ClassNotFoundException ignored)
|
||||
else
|
||||
{
|
||||
context.getLogger().info("PCGF-PluginLib not installed. Switching to standalone mode!");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user