Skip to content

Commit

Permalink
version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
powercasgamer committed Jul 7, 2024
1 parent 3c8016f commit 7953663
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ include (
'spark-velocity4',
'spark-sponge7',
'spark-sponge8',
'spark-forge',
'spark-neoforge',
'spark-fabric',
// 'spark-forge',
// 'spark-neoforge',
// 'spark-fabric',
'spark-nukkit',
'spark-waterdog',
//'spark-minestom', // disabled until minestom publish their maven artifacts to a proper repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ public String getName() {
@Override
public String getVersion() {
final String version = this.server.getVersion();
String brand;

if (version.contains("Spigot")) {
brand = null;
} else {
brand = this.server.getName();
String brand = null;

if (BukkitSparkPlugin.classExists("io.papermc.paper.ServerBuildInfo")) {
if (version.contains("Spigot")) {
brand = null;
} else {
brand = this.server.getName();
}
}
return (brand == null ? "" : brand + " ") + this.server.getVersion();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public void registerApi(Spark api) {
getServer().getServicesManager().register(Spark.class, api, this, ServicePriority.Normal);
}

private static boolean classExists(String className) {
protected static boolean classExists(String className) {
try {
Class.forName(className);
return true;
Expand Down

0 comments on commit 7953663

Please sign in to comment.