Skip to content

Commit 44769ea

Browse files
committed
Fixed %neptune_color% breaking for spectators
1 parent 94a43eb commit 44769ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Plugin/src/main/java/dev/lrxh/neptune/providers/placeholder/impl/ColorPlaceholder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import dev.lrxh.neptune.API;
44
import dev.lrxh.neptune.game.match.Match;
5+
import dev.lrxh.neptune.game.match.impl.participant.Participant;
56
import dev.lrxh.neptune.profile.impl.Profile;
67
import dev.lrxh.neptune.providers.placeholder.Placeholder;
78
import org.bukkit.OfflinePlayer;
@@ -17,6 +18,9 @@ public String parse(OfflinePlayer player, String string) {
1718
Profile profile = API.getProfile(player);
1819
if (profile == null) return string;
1920
Match match = profile.getMatch();
20-
return match != null ? match.getParticipant(player.getUniqueId()).getColor().getColor() : "";
21+
if (match == null) return string;
22+
Participant participant = match.getParticipant(player.getUniqueId());
23+
if (participant == null) return string;
24+
return participant.getColor().getColor();
2125
}
2226
}

0 commit comments

Comments
 (0)