Skip to content

Commit 316372f

Browse files
authored
Merge pull request #463 from riveur/fix/mvp_plus_custom_plus_color
2 parents 05ffeb5 + ac3ccaa commit 316372f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/helpers/PlayerRank.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ export function getPlayerRank(
275275
customPlusColor as keyof typeof MinecraftColorAsHex
276276
];
277277
}
278+
if (out.priority === PlayerRanks.MVP_PLUS) {
279+
out.prefix = `§b[MVP${customPlusColor ?? "§c"}+§b]`;
280+
}
278281
if (out.priority === PlayerRanks.SUPERSTAR) {
279282
out.prefix = `${customRankColor ?? "§6"}[MVP${customPlusColor ?? "§c"}++${
280283
customRankColor ?? "§6"

tests/helpers.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ describe("Test PlayerRank helper", function () {
111111
);
112112
expect(rank.name).to.be.a("string").that.equals("MVP_PLUS");
113113
});
114+
it("should return MVP+ with black +", function () {
115+
const rank = getPlayerRank(
116+
{ newPackageRank: "MVP_PLUS", rankPlusColor: "BLACK" } as never,
117+
false
118+
);
119+
expect(rank.prefix).to.be.a("string").that.equals("§b[MVP§0+§b]");
120+
});
114121
it("should return MVP", function () {
115122
const rank = getPlayerRank(
116123
{ newPackageRank: "MVP", packageRank: "VIP" } as never,

0 commit comments

Comments
 (0)