Small bug fix (API didn't follow config-settings for use-dots)

This commit is contained in:
Artemis-the-gr8 2022-08-19 18:43:30 +02:00
parent 329bc8fb10
commit 73c7fd8445
4 changed files with 14 additions and 8 deletions

View File

@ -4,7 +4,7 @@
<groupId>io.github.ithotl</groupId>
<artifactId>PlayerStats</artifactId>
<name>PlayerStats</name>
<version>1.7</version>
<version>1.7.1</version>
<description>Statistics Plugin</description>
<url>https://www.spigotmc.org/resources/playerstats.102347/</url>
<developers>

View File

@ -6,7 +6,7 @@
<groupId>io.github.ithotl</groupId>
<artifactId>PlayerStats</artifactId>
<version>1.7</version>
<version>1.7.1</version>
<name>PlayerStats</name>
<description>Statistics Plugin</description>

View File

@ -463,16 +463,22 @@ public final class MessageBuilder implements ApiFormatter {
}
private TextComponent getTopStatLineComponent(int positionInTopList, String playerName, TextComponent statNumberComponent) {
boolean useDots = config.useDots();
String fullPlayerName = useDots ? playerName : playerName + ":";
TextComponent.Builder topStatLineBuilder = Component.text()
.append(space())
.append(componentFactory.rankNumber(positionInTopList))
.append(space())
.append(componentFactory.playerName(playerName, Target.TOP))
.append(space());
.append(componentFactory.playerName(fullPlayerName, Target.TOP));
int dots = getNumberOfDotsToAlign(positionInTopList + ". " + playerName);
if (dots >= 1) {
topStatLineBuilder.append(componentFactory.dots(".".repeat(dots)));
if (config.useDots()) {
int dots = getNumberOfDotsToAlign(positionInTopList + ". " + playerName);
if (dots >= 1) {
topStatLineBuilder
.append(space())
.append(componentFactory.dots(".".repeat(dots)));
}
}
return topStatLineBuilder

View File

@ -1,6 +1,6 @@
main: com.artemis.the.gr8.playerstats.Main
name: PlayerStats
version: 1.7
version: 1.7.1
api-version: 1.13
description: adds commands to view player statistics in chat
author: Artemis_the_gr8