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

Commit

Permalink
Fix name not showing up correctly in PollKick
Browse files Browse the repository at this point in the history
  • Loading branch information
cswhite2000 committed Jan 8, 2018
1 parent 4f28b44 commit 2359476
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions PGM/src/main/java/tc/oc/pgm/polls/types/PollKick.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,32 @@ public interface Factory {
PollKick create(PlayerId initiator, Player player);
}

private final Player player;
private final PlayerId player;
private final IdentityProvider identityProvider;
private final PunishmentCreator punishmentCreator;
private final UserStore userStore;

@AssistedInject PollKick(@Assisted PlayerId initiator, @Assisted Player player, PollManager pollManager, Audiences audiences, IdentityProvider identityProvider, PunishmentCreator punishmentCreator, UserStore userStore) {
super(pollManager, initiator, audiences);
this.player = player;
this.identityProvider = identityProvider;
this.punishmentCreator = punishmentCreator;
this.userStore = userStore;
this.player = userStore.playerId(player);
}

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

@Override
public String getActionString() {
return normalize + "Kick: " + boldAqua + this.player;
return normalize + "Kick: " + boldAqua + this.player.username();
}

@Override
public String getDescriptionMessage() {
return "to kick " + boldAqua + this.player;
return "to kick " + boldAqua + this.player.username();
}
}

0 comments on commit 2359476

Please sign in to comment.