-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question]: /money top = showing Null players, when Towny is installed. #24
Comments
Yes, i had the same issue. |
Would you like to remove them from the database or just to not show them in the baltop? |
Or update to 1.2.1-SNAPSHOT |
I can say only i this confirm with towny. |
Issue with null player name is because towny using npc fake accounts. And LiteEco don't know what is fake account. |
I made a command to remove null players but the implementation is not elegant (Iterating over HashMap obtained from Baltop) Do you think this command could be a feature? |
Hello, Thank you for your responses. So the "null" players is being generated by towny? And in order to remove them from showing in Baltop is to access databese.db? |
I'm not sure if this is a possible way, because everytime towny generating accounts. Towny must be blocked for now,
In this, case you don't have tools how delete null accounts because database.db can't be opened with programs. |
The thing is, towns SHOULD have names, normally they aren't null and are something like |
Yes of course, you have right but, but this is a FakePlayer, with uuid.
For third solution. I think this is a simple solution, but need tests. val balances = liteEco.api.getTopBalance().entries.sortedByDescending { e -> e.value }
.filter { data -> Bukkit.getOfflinePlayer(UUID.fromString(data.key)).hasPlayedBefore() }
.positionIndexed { index, mutableEntry -> LegacyComponentSerializer.legacyAmpersand().serialize(ModernText.miniModernText(
liteEco.translationConfig.getMessage("messages.balance_top_format"),
TagResolver.resolver(
Placeholder.parsed("position", index.toString()),
Placeholder.parsed(
"player",
Bukkit.getOfflinePlayer(UUID.fromString(mutableEntry.key)).name.toString()
),
Placeholder.parsed("money", liteEco.api.formatting(mutableEntry.value))
)
)) } OR val balances = liteEco.api.getTopBalance().entries.sortedByDescending { e -> e.value }
.filter { data -> Bukkit.getOfflinePlayer(UUID.fromString(data.key)).name.isNullOrEmpty() }
.positionIndexed { index, mutableEntry -> LegacyComponentSerializer.legacyAmpersand().serialize(ModernText.miniModernText(
liteEco.translationConfig.getMessage("messages.balance_top_format"),
TagResolver.resolver(
Placeholder.parsed("position", index.toString()),
Placeholder.parsed(
"player",
Bukkit.getOfflinePlayer(UUID.fromString(mutableEntry.key)).name.toString()
),
Placeholder.parsed("money", liteEco.api.formatting(mutableEntry.value))
)
)) } |
But i think there is not another necessary, add another functions. But Imho, idk. |
I see now. Beware that if you add a new column this could happen:
But fixeable |
Plugin Towny is not supported for now, maybe in future... |
Your Question
I have question about top players list, some of it is showing null. Is there a way to remove it? I would appreciate all answers.
The text was updated successfully, but these errors were encountered: