Major changes

- Convert prefixes to Component
- Styling improvements to the list command
- Fix tab completing on plex command
- Allow console to check ranks of other players
- Add coloring in tab for admins
- Add color field to ranks and titles
- Fix debug logging not working
This commit is contained in:
2022-03-17 20:18:35 -05:00
parent 3c0b79ba06
commit 06e51926be
18 changed files with 155 additions and 74 deletions

View File

@ -10,6 +10,8 @@ import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.UUID;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
/**
* SQL fetching utilities for players
@ -66,7 +68,7 @@ public class SQLPlayerData
{
String name = set.getString("name");
String loginMSG = set.getString("login_msg");
String prefix = set.getString("prefix");
Component prefix = Component.text(set.getString("prefix"));
String rankName = set.getString("rank").toUpperCase();
long coins = set.getLong("coins");
boolean vanished = set.getBoolean("vanished");
@ -105,7 +107,7 @@ public class SQLPlayerData
PreparedStatement statement = con.prepareStatement(UPDATE);
statement.setString(1, player.getName());
statement.setString(2, player.getLoginMessage());
statement.setString(3, player.getPrefix());
statement.setString(3, LegacyComponentSerializer.legacySection().serialize(player.getPrefix()));
statement.setString(4, player.getRank().toLowerCase());
statement.setString(5, new Gson().toJson(player.getIps()));
statement.setLong(6, player.getCoins());
@ -134,7 +136,7 @@ public class SQLPlayerData
statement.setString(1, player.getUuid());
statement.setString(2, player.getName());
statement.setString(3, player.getLoginMessage());
statement.setString(4, player.getPrefix());
statement.setString(4, LegacyComponentSerializer.legacySection().serialize(player.getPrefix()));
statement.setString(5, player.getRank().toLowerCase());
statement.setString(6, new Gson().toJson(player.getIps()));
statement.setLong(7, player.getCoins());