Skip to content
This repository was archived by the owner on Nov 25, 2019. It is now read-only.

Commit 3c74a30

Browse files
committed
Fix name not showing up correctly in PollKick
1 parent a38db72 commit 3c74a30

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

PGM/src/main/java/tc/oc/pgm/polls/types/PollKick.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,32 @@ public interface Factory {
2121
PollKick create(PlayerId initiator, Player player);
2222
}
2323

24-
private final Player player;
24+
private final PlayerId player;
2525
private final IdentityProvider identityProvider;
2626
private final PunishmentCreator punishmentCreator;
2727
private final UserStore userStore;
2828

2929
@AssistedInject PollKick(@Assisted PlayerId initiator, @Assisted Player player, PollManager pollManager, Audiences audiences, IdentityProvider identityProvider, PunishmentCreator punishmentCreator, UserStore userStore) {
3030
super(pollManager, initiator, audiences);
31-
this.player = player;
3231
this.identityProvider = identityProvider;
3332
this.punishmentCreator = punishmentCreator;
3433
this.userStore = userStore;
34+
this.player = userStore.playerId(player);
3535
}
3636

3737
@Override
3838
public void executeAction() {
39-
PlayerId kicked = userStore.playerId(player);
40-
punishmentCreator.create(null, kicked, "The poll to kick " + kicked.username() + " succeeded", PunishmentDoc.Type.KICK, null, false, false, true);
39+
punishmentCreator.create(null, player, "The poll to kick " + player.username() + " succeeded", PunishmentDoc.Type.KICK, null, false, false, true);
4140
audiences.localServer().sendMessage(new Component(ChatColor.DARK_AQUA).translate("poll.kick.success", new PlayerComponent(identityProvider.currentIdentity(player))));
4241
}
4342

4443
@Override
4544
public String getActionString() {
46-
return normalize + "Kick: " + boldAqua + this.player;
45+
return normalize + "Kick: " + boldAqua + this.player.username();
4746
}
4847

4948
@Override
5049
public String getDescriptionMessage() {
51-
return "to kick " + boldAqua + this.player;
50+
return "to kick " + boldAqua + this.player.username();
5251
}
5352
}

0 commit comments

Comments
 (0)