diff --git a/build.gradle b/build.gradle index f74f646..01bdf37 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { apply plugin: 'maven-publish' group = 'io.github.divios' -version = '2.4' +version = '3.0' sourceCompatibility = 1.8 // java 8 targetCompatibility = 1.8 diff --git a/src/main/java/io/github/divios/jtext/parsers/miniTextParser.java b/src/main/java/io/github/divios/jtext/parsers/miniTextParser.java index c3f621d..999ec47 100644 --- a/src/main/java/io/github/divios/jtext/parsers/miniTextParser.java +++ b/src/main/java/io/github/divios/jtext/parsers/miniTextParser.java @@ -8,17 +8,18 @@ public class miniTextParser { private static MiniMessage builder; public miniTextParser() { - builder = MiniMessage.miniMessage(); + if (adventureIsInstalled()) + builder = MiniMessage.miniMessage(); } public String parse(final String s) { - if (!adventureIsInstalled()) return s; + if (builder != null) return s; return LegacyComponentSerializer.legacyAmpersand().serialize( builder.parse(s)); } public String unParse(final String s) { - if (!adventureIsInstalled()) return null; + if (builder != null) return null; return null; } @@ -26,10 +27,8 @@ private boolean adventureIsInstalled() { try { Class.forName("net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer"); } catch (ClassNotFoundException e) { - System.out.println("Adventure not found"); return false; } - System.out.println("Adventure found"); return true; }