-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect version number in mcstats
- Loading branch information
Showing
2 changed files
with
3 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,11 @@ | ||
package nallar.tickprofiler.util; | ||
|
||
import net.minecraft.server.MinecraftServer; | ||
import cpw.mods.fml.common.Loader; | ||
|
||
// 'constants' aren't constant, the build script replaces them with versioning information | ||
@SuppressWarnings("MethodReturnAlwaysConstant") | ||
public enum VersionUtil { | ||
; | ||
|
||
public static String detailedVersion() { | ||
String version = ""; | ||
try { | ||
MinecraftServer minecraftServer = MinecraftServer.getServer(); | ||
if (minecraftServer != null) { | ||
version = " on " + minecraftServer.getMinecraftVersion() + ' ' + minecraftServer.getServerModName(); | ||
} | ||
} catch (NoClassDefFoundError ignored) { | ||
} | ||
return version() + version; | ||
} | ||
|
||
public static String version() { | ||
return "@MOD_NAME@ v@MOD_VERSION@ for MC@MC_VERSION@"; | ||
} | ||
|
||
public static String versionNumber() { | ||
return "@MOD_VERSION@"; | ||
return Loader.instance().getIndexedModList().get("TickProfiler").getVersion(); | ||
} | ||
} |