Skip to content

Commit bd2b3f3

Browse files
committed
fix(spigot): bump adventure version check to 4.18.0
Minimessage requires at least adventure 4.18.0, so we require that version now.
1 parent 231240e commit bd2b3f3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

triton-spigot/loader/src/main/java/com/rexcantor64/triton/loader/SpigotLoader.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ private boolean shouldRelocateAdventure() {
3131
// TODO manual override
3232

3333
try {
34-
// Class only available on adventure 4.15.0+
35-
Class.forName("net.kyori.adventure.resource.ResourcePackCallback");
34+
// Method only available on adventure 4.18.0+
35+
// Required for minimessage to work
36+
// We have to check the method because other plugins might add the ShadowColor class even though it's not used
37+
Class<?> styleClass = Class.forName("net.kyori.adventure.text.format.StyleGetter");
38+
styleClass.getDeclaredMethod("shadowColor");
3639

3740
// A modern version of adventure is already present
3841
return false;
39-
} catch (ClassNotFoundException ignore) {
42+
} catch (ClassNotFoundException | NoSuchMethodException ignore) {
4043
// Adventure is not present or an outdated version is present
4144
return true;
4245
}

0 commit comments

Comments
 (0)