File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
commandapi-platforms/commandapi-paper/commandapi-paper-nms/commandapi-paper-dv
src/main/java/dev/jorel/commandapi/nms Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 12
12
<artifactId >commandapi-paper-dv</artifactId >
13
13
14
14
<properties >
15
- <minecraft .mappings>1.20.1 -R0.1-SNAPSHOT</minecraft .mappings>
16
- <spigot .version>1.20.1 -R0.1-SNAPSHOT</spigot .version>
17
- <paper .version>1.20.1 -R0.1-SNAPSHOT</paper .version>
15
+ <minecraft .mappings>1.20.6 -R0.1-SNAPSHOT</minecraft .mappings>
16
+ <spigot .version>1.20.6 -R0.1-SNAPSHOT</spigot .version>
17
+ <paper .version>1.20.6 -R0.1-SNAPSHOT</paper .version>
18
18
</properties >
19
19
20
20
<repositories >
26
26
<id >codemc-repo</id >
27
27
<url >https://repo.codemc.io/repository/nms/</url >
28
28
</repository >
29
+ <repository >
30
+ <id >papermc</id >
31
+ <url >https://repo.papermc.io/repository/maven-public/</url >
32
+ </repository >
29
33
</repositories >
30
34
31
35
<dependencies >
36
+ <dependency >
37
+ <groupId >io.papermc.paper</groupId >
38
+ <artifactId >paper-api</artifactId >
39
+ <version >${paper.version} </version >
40
+ <scope >provided</scope >
41
+ </dependency >
32
42
<dependency >
33
43
<groupId >org.spigotmc</groupId >
34
44
<artifactId >spigot</artifactId >
60
70
<plugin >
61
71
<groupId >net.md-5</groupId >
62
72
<artifactId >specialsource-maven-plugin</artifactId >
63
- <version >1.2 .4</version >
73
+ <version >2.0 .4</version >
64
74
<executions >
65
75
<execution >
66
76
<phase >package</phase >
Original file line number Diff line number Diff line change 1
1
package dev .jorel .commandapi .nms ;
2
2
3
+ import io .papermc .paper .ServerBuildInfo ;
3
4
import net .minecraft .SharedConstants ;
4
5
5
6
public class DetectVersion {
6
7
7
8
private DetectVersion () {}
8
9
9
10
public static String getVersion () {
10
- return SharedConstants .getCurrentVersion ().getId ();
11
+ try {
12
+ return ServerBuildInfo .buildInfo ().minecraftVersionId ();
13
+ } catch (Throwable t ) {
14
+ // We don't even care what the exception was, we just know that if it throws, we are on a version that doesn't have
15
+ // the ServerBuildInfo so we can fall back to internals which are all the same on versions on and before 1.20.6
16
+ return SharedConstants .getCurrentVersion ().getId ();
17
+ }
11
18
}
12
19
13
20
}
You can’t perform that action at this time.
0 commit comments