From ecb78ba45c4733743e65f9f6ab1510109999f7bc Mon Sep 17 00:00:00 2001 From: kevinbarnes Date: Tue, 30 Nov 2021 12:20:36 -0500 Subject: [PATCH] remove old code D: --- CHANGELOG.md | 10 ++++++++++ .../majek/hexnicks/event/PaperTabCompleteEvent.java | 9 +-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bf1cb0..201d900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Plugin Changelog +# 2.2.0 - Async Everything + +- Switched access to MySQL database from synchronous to asynchronous. +- Added support for `autoReconnect` flag for MySQL. +- Implemented feature requested in #36. Options for disabling text decorations. +- Did some normal code cleanup. +- Fixed bug with overflowing colors in chat on Spigot. + +Okay not async *everything* but a lot of stuff that should be async now is! + # 2.1.4 - Essentials Compatibility - New EssentialsHook should allow HexNicks and Essentials to work with one another out of the box. diff --git a/src/main/java/dev/majek/hexnicks/event/PaperTabCompleteEvent.java b/src/main/java/dev/majek/hexnicks/event/PaperTabCompleteEvent.java index 1d3c850..cc7244a 100644 --- a/src/main/java/dev/majek/hexnicks/event/PaperTabCompleteEvent.java +++ b/src/main/java/dev/majek/hexnicks/event/PaperTabCompleteEvent.java @@ -28,8 +28,6 @@ import dev.majek.hexnicks.Nicks; import java.util.stream.Collectors; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.jetbrains.annotations.NotNull; @@ -43,11 +41,6 @@ public class PaperTabCompleteEvent implements Listener { @EventHandler public void onTabComplete(AsyncTabCompleteEvent event) { String[] args = event.getBuffer().split(" "); - // Replace if the event was returning online players - if (event.completions().stream().map(AsyncTabCompleteEvent.Completion::suggestion).collect(Collectors.toList()) - .equals(Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList()))) { - nickCompletions(event, args); - } if (!event.isCommand()) { return; } @@ -56,7 +49,7 @@ public void onTabComplete(AsyncTabCompleteEvent event) { } } - public void nickCompletions(@NotNull AsyncTabCompleteEvent event, String[] args) { + public void nickCompletions(@NotNull AsyncTabCompleteEvent event, @NotNull String[] args) { if (args.length > 1) { event.completions(Nicks.core().getNickMap().values().stream().filter(nickname -> PlainTextComponentSerializer.plainText().serialize(nickname).startsWith(args[1])).map(nickname ->