mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-03-11 14:09:56 +01:00
Adds SongodaCore#getVersion
and deprecate #getCoreLibraryVersion
This commit is contained in:
parent
163e4d9eaf
commit
b779194e3e
@ -281,6 +281,10 @@ public class SongodaCore {
|
||||
return new ArrayList<>(registeredPlugins);
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
return SongodaCoreConstants.getCoreVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getCoreMajorVersion()} instead, but careful, coreRevision is at 9 while major version is at 2
|
||||
*/
|
||||
@ -289,12 +293,13 @@ public class SongodaCore {
|
||||
return coreRevision;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static String getCoreLibraryVersion() {
|
||||
return SongodaCoreConstants.getCoreVersion();
|
||||
}
|
||||
|
||||
public static int getCoreMajorVersion() {
|
||||
String fullVersion = getCoreLibraryVersion();
|
||||
String fullVersion = getVersion();
|
||||
if (fullVersion.contains(".")) {
|
||||
return Integer.parseInt(fullVersion.substring(0, fullVersion.indexOf(".")));
|
||||
}
|
||||
|
@ -211,7 +211,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
||||
"Unexpected error while loading %s v%s (core v%s): Disabling plugin!",
|
||||
getDescription().getName(),
|
||||
getDescription().getVersion(),
|
||||
SongodaCore.getCoreLibraryVersion()
|
||||
SongodaCore.getVersion()
|
||||
), th);
|
||||
|
||||
emergencyStop();
|
||||
|
@ -75,19 +75,12 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>${nms.ver}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>${nms.ver}</version>
|
||||
<scope>provided</scope>
|
||||
<classifier>remapped-mojang</classifier>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user