Skip to content

Commit f7b5037

Browse files
committed
Fix version information
1 parent 206018b commit f7b5037

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ repositories {
2424

2525
jar {
2626
manifest.attributes('Main-Class': 'de.oceanlabs.mcp.mcinjector.MCInjector')
27+
manifest.attributes('Implementation-Version': project.version)
2728
}
2829
shadowJar {
2930
classifier 'fatjar'
3031
manifest.attributes('Main-Class': 'de.oceanlabs.mcp.mcinjector.MCInjector')
32+
manifest.attributes('Implementation-Version': project.version)
3133
}
3234

3335
artifacts {

src/main/java/de/oceanlabs/mcp/mcinjector/MCInjector.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,14 @@
1212
public class MCInjector
1313
{
1414
private final static Logger log = Logger.getLogger("MCInjector");
15-
public static final String VERSION = "MCInjector v3.4 by Searge, LexManos, Fesh0r";
15+
public static final String VERSION;
16+
static {
17+
String implVersion = MCInjector.class.getPackage().getImplementationVersion();
18+
if (implVersion == null) {
19+
implVersion = "Unknown";
20+
}
21+
VERSION = "MCInjector v" + implVersion + " by Searge, LexManos, Fesh0r";
22+
}
1623

1724
public static void main(String[] args) throws Exception
1825
{

0 commit comments

Comments
 (0)