mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-02 12:56:40 +00:00
Lots of fixes and cool shit
- Fixes bug that caused login messages to not show properly - Fixes bug that caused names to now show properly in tab - Adds the ability for commands to be ignored if plugins that they require aren't present - Fixes bug that caused the admin list to fail to load properly - Fixes bug that caused tags to not show properly - Login messages now use MiniMessage
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
package me.totalfreedom.totalfreedommod.player;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
import me.totalfreedom.totalfreedommod.api.ShopItem;
|
||||
import me.totalfreedom.totalfreedommod.util.FConverter;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
@ -50,7 +53,7 @@ public class PlayerData
|
||||
ips.addAll(FUtil.stringToList(resultSet.getString("ips")));
|
||||
notes.clear();
|
||||
notes.addAll(FUtil.stringToList(resultSet.getString("notes")));
|
||||
tag = LegacyComponentSerializer.legacyAmpersand().deserialize(resultSet.getString("tag"));
|
||||
tag = FUtil.miniMessage(resultSet.getString("tag"));
|
||||
discordID = resultSet.getString("discord_id");
|
||||
masterBuilder = resultSet.getBoolean("master_builder");
|
||||
rideMode = RideMode.valueOf(resultSet.getString("ride_mode").toUpperCase());
|
||||
@ -59,11 +62,19 @@ public class PlayerData
|
||||
items.addAll(FUtil.stringToList(resultSet.getString("items")));
|
||||
totalVotes = resultSet.getInt("total_votes");
|
||||
displayDiscord = resultSet.getBoolean("display_discord");
|
||||
loginMessage = resultSet.getString("login_message");
|
||||
//--
|
||||
String tempLoginMessage = resultSet.getString("login_message");
|
||||
if (!Strings.isNullOrEmpty(tempLoginMessage) && FConverter.needsConversion(tempLoginMessage))
|
||||
{
|
||||
tempLoginMessage = FConverter.convertLoginMessage(tempLoginMessage);
|
||||
}
|
||||
loginMessage = tempLoginMessage;
|
||||
//--
|
||||
inspect = resultSet.getBoolean("inspect");
|
||||
} catch (SQLException e)
|
||||
{
|
||||
FLog.severe("Failed to load player: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,7 +201,7 @@ public class PlayerData
|
||||
objectMap.put("uuid", uuid.toString());
|
||||
objectMap.put("ips", FUtil.listToString(ips));
|
||||
objectMap.put("notes", FUtil.listToString(notes));
|
||||
objectMap.put("tag", tag.toString());
|
||||
objectMap.put("tag", FUtil.miniMessage(tag));
|
||||
objectMap.put("discord_id", discordID);
|
||||
objectMap.put("master_builder", masterBuilder);
|
||||
objectMap.put("ride_mode", rideMode.name());
|
||||
|
Reference in New Issue
Block a user