diff --git a/README.md b/README.md index 8782a9c97..83e8f0c82 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ For more information, see the wiki article on [Why LuckPerms?](https://luckperms LuckPerms uses Gradle to handle dependencies & building. #### Requirements -* Java 8 JDK or newer +* Java 17 JDK or newer * Git #### Compiling from source diff --git a/standalone/app/build.gradle b/standalone/app/build.gradle index ee7edfdb9..708f45f97 100644 --- a/standalone/app/build.gradle +++ b/standalone/app/build.gradle @@ -18,21 +18,21 @@ dependencies { api 'com.google.guava:guava:31.1-jre' api 'io.netty:netty-all:4.1.93.Final' - api('net.kyori:adventure-api:4.11.0') { + api('net.kyori:adventure-api:4.14.0') { exclude(module: 'adventure-bom') exclude(module: 'checker-qual') exclude(module: 'annotations') } - api('net.kyori:adventure-text-serializer-gson:4.11.0') { + api('net.kyori:adventure-text-serializer-gson:4.14.0') { exclude(module: 'adventure-bom') exclude(module: 'adventure-api') exclude(module: 'gson') } - api('net.kyori:adventure-text-serializer-legacy:4.11.0') { + api('net.kyori:adventure-text-serializer-legacy:4.14.0') { exclude(module: 'adventure-bom') exclude(module: 'adventure-api') } - api('net.kyori:adventure-text-serializer-plain:4.11.0') { + api('net.kyori:adventure-text-serializer-plain:4.14.0') { exclude(module: 'adventure-bom') exclude(module: 'adventure-api') } @@ -40,7 +40,14 @@ dependencies { exclude(module: 'adventure-bom') exclude(module: 'adventure-api') } - api('net.kyori:ansi:1.0.1') + api('net.kyori:adventure-text-serializer-ansi:4.14.0') { + exclude(module: 'adventure-bom') + exclude(module: 'adventure-api') + exclude(module: 'annotations') + } + api('net.kyori:ansi:1.0.3') { + exclude(module: 'annotations') + } } blossom { diff --git a/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/integration/SingletonPlayer.java b/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/integration/SingletonPlayer.java index 8d2453f74..0df81372b 100644 --- a/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/integration/SingletonPlayer.java +++ b/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/integration/SingletonPlayer.java @@ -26,8 +26,9 @@ package me.lucko.luckperms.standalone.app.integration; import me.lucko.luckperms.standalone.app.LuckPermsApplication; -import me.lucko.luckperms.standalone.app.utils.AnsiUtils; import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.serializer.ansi.ANSIComponentSerializer; +import net.kyori.ansi.ColorLevel; import java.util.Set; import java.util.UUID; @@ -46,7 +47,7 @@ public class SingletonPlayer { private static final UUID UUID = new UUID(0, 0); /** A message sink that prints the component to stdout */ - private static final Consumer PRINT_TO_STDOUT = component -> LuckPermsApplication.LOGGER.info(AnsiUtils.format(component)); + private static final Consumer PRINT_TO_STDOUT = component -> LuckPermsApplication.LOGGER.info(ANSIComponentSerializer.ansi().serialize(component)); /** Singleton instance */ public static final SingletonPlayer INSTANCE = new SingletonPlayer(); diff --git a/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/utils/AnsiUtils.java b/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/utils/AnsiUtils.java deleted file mode 100644 index 048831e32..000000000 --- a/standalone/app/src/main/java/me/lucko/luckperms/standalone/app/utils/AnsiUtils.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * This file is part of LuckPerms, licensed under the MIT License. - * - * Copyright (c) lucko (Luck) - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package me.lucko.luckperms.standalone.app.utils; - -import net.kyori.adventure.key.Key; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.flattener.ComponentFlattener; -import net.kyori.adventure.text.flattener.FlattenerListener; -import net.kyori.adventure.text.format.Style; -import net.kyori.adventure.text.format.TextColor; -import net.kyori.adventure.text.format.TextDecoration; -import net.kyori.ansi.ANSIComponentRenderer; -import net.kyori.ansi.StyleOps; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.Range; - -/** - * Utility to format a {@link Component} as an ANSI string. - */ -public final class AnsiUtils { - private AnsiUtils() {} - - public static String format(Component component) { - ANSIComponentRenderer.ToString