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> <groupId>io.github.ithotl</groupId>
<artifactId>PlayerStats</artifactId> <artifactId>PlayerStats</artifactId>
<name>PlayerStats</name> <name>PlayerStats</name>
<version>1.7</version> <version>1.7.1</version>
<description>Statistics Plugin</description> <description>Statistics Plugin</description>
<url>https://www.spigotmc.org/resources/playerstats.102347/</url> <url>https://www.spigotmc.org/resources/playerstats.102347/</url>
<developers> <developers>

View File

@ -6,7 +6,7 @@
<groupId>io.github.ithotl</groupId> <groupId>io.github.ithotl</groupId>
<artifactId>PlayerStats</artifactId> <artifactId>PlayerStats</artifactId>
<version>1.7</version> <version>1.7.1</version>
<name>PlayerStats</name> <name>PlayerStats</name>
<description>Statistics Plugin</description> <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) { private TextComponent getTopStatLineComponent(int positionInTopList, String playerName, TextComponent statNumberComponent) {
boolean useDots = config.useDots();
String fullPlayerName = useDots ? playerName : playerName + ":";
TextComponent.Builder topStatLineBuilder = Component.text() TextComponent.Builder topStatLineBuilder = Component.text()
.append(space()) .append(space())
.append(componentFactory.rankNumber(positionInTopList)) .append(componentFactory.rankNumber(positionInTopList))
.append(space()) .append(space())
.append(componentFactory.playerName(playerName, Target.TOP)) .append(componentFactory.playerName(fullPlayerName, Target.TOP));
.append(space());
int dots = getNumberOfDotsToAlign(positionInTopList + ". " + playerName); if (config.useDots()) {
if (dots >= 1) { int dots = getNumberOfDotsToAlign(positionInTopList + ". " + playerName);
topStatLineBuilder.append(componentFactory.dots(".".repeat(dots))); if (dots >= 1) {
topStatLineBuilder
.append(space())
.append(componentFactory.dots(".".repeat(dots)));
}
} }
return topStatLineBuilder return topStatLineBuilder

View File

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