Skip to content

Commit

Permalink
Small bug fixes for super votes
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <applenick@users.noreply.github.com>
  • Loading branch information
applenick committed Jul 1, 2024
1 parent c8a699e commit 0b6b95b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,7 @@ private void sendSuperVoterActivationFeedback(Player player) {
if (getRequestConfig().isSuperVoteBroadcast()) {
Component alert = text()
.append(MessageUtils.VOTE)
.appendSpace()
.append(player(player, NameStyle.FANCY))
.append(text(" has activated a ", NamedTextColor.YELLOW))
.append(text("super vote", NamedTextColor.LIGHT_PURPLE, TextDecoration.BOLD))
Expand All @@ -885,6 +886,7 @@ private void sendSuperVoterActivationFeedback(Player player) {
} else {
viewer.sendMessage(text()
.append(MessageUtils.VOTE)
.appendSpace()
.append(text("You activated a ", NamedTextColor.YELLOW))
.append(text("super vote", NamedTextColor.LIGHT_PURPLE, TextDecoration.BOLD))
.append(text("!", NamedTextColor.YELLOW)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.UUID;
import java.util.logging.Logger;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionAttachment;
import tc.oc.pgm.api.PGM;
Expand Down Expand Up @@ -70,23 +69,12 @@ private void applySuperVotePermissions(Player player) {
new StoredPermission(player, getExtraVotePermission(multipliedVoteLevel));
permission.enable();
playerPermissions.put(player.getUniqueId(), permission);

// DEBUG:
player.sendMessage(ChatColor.GREEN
+ "You now have "
+ ChatColor.AQUA
+ " pgm.vote.extra."
+ multipliedVoteLevel);
}

private void removeSuperVotePermissions(Player player) {
StoredPermission permission = playerPermissions.remove(player.getUniqueId());
if (permission != null) {
permission.disable(player);

// DEBUG:
player.sendMessage(
ChatColor.RED + "You no longer have " + ChatColor.AQUA + permission.getPermission());
}
}

Expand Down

0 comments on commit 0b6b95b

Please sign in to comment.