Skip to content

Commit

Permalink
remove old code D:
Browse files Browse the repository at this point in the history
  • Loading branch information
Majekdor committed Nov 30, 2021
1 parent fe0b86c commit ecb78ba
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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 ->
Expand Down

0 comments on commit ecb78ba

Please sign in to comment.