File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
cloud-bukkit/src/main/java/org/incendo/cloud/bukkit/internal Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,15 @@ public final class CraftBukkitReflection {
7474 final Class <?> sharedConstants = needClass ("net.minecraft.SharedConstants" );
7575 final Method getCurrentVersion = sharedConstants .getDeclaredMethod ("getCurrentVersion" );
7676 final Object currentVersion = getCurrentVersion .invoke (null );
77- final Method getName = currentVersion .getClass ().getDeclaredMethod ("getName" );
77+ Method getName = null ;
78+ try {
79+ getName = currentVersion .getClass ().getDeclaredMethod ("getName" );
80+ } catch (final NoSuchMethodException ignored ) {
81+ }
82+ if (getName == null ) {
83+ // ~1.21.6+
84+ getName = currentVersion .getClass ().getDeclaredMethod ("name" );
85+ }
7886 final String versionName = (String ) getName .invoke (currentVersion );
7987 try {
8088 fallbackVersion = Integer .parseInt (versionName .split ("\\ ." )[1 ]);
You can’t perform that action at this time.
0 commit comments