0

Play Now

Click to Copy IP

Fix the mute system [an actual issue.]

Fix the mute system [an actual issue.]

so um yeah you can still message after being muted on the server.

me when
Java:
public class MutedChatListener implements Listener {
    @EventHandler
    public void onChat(AsyncPlayerChatEvent e){
        Player player = e.getPlayer();
        Profile profile = profileService.getProfile(player.getUniqueId());
        if (profile.hasActivePunishment(PunishmentType.MUTE)){
            e.setCancelled(true);
            if (profile.getMostRecentPunishment(PunishmentType.MUTE).getDuration() == 0){
                player.sendMessage(ChatColor.RED + "You cannot speak as you are muted permanently\n You were muted for: " + profile.getMostRecentPunishment(PunishmentType.MUTE).getReason());
            } else {
                player.sendMessage(ChatColor.RED + "You cannot speak as you are muted for " + TimeUtil.parseTime(System.currentTimeMillis() - profile.getMostRecentPunishment(PunishmentType.MUTE).getDuration()) + ".\n You were muted for " + profile.getMostRecentPunishment(PunishmentType.MUTE).getReason()) + ".");
            }
        }
    }
}
 
me when
Java:
public class MutedChatListener implements Listener {
    @EventHandler
    public void onChat(AsyncPlayerChatEvent e){
        Player player = e.getPlayer();
        Profile profile = profileService.getProfile(player.getUniqueId());
        if (profile.hasActivePunishment(PunishmentType.MUTE)){
            e.setCancelled(true);
            if (profile.getMostRecentPunishment(PunishmentType.MUTE).getDuration() == 0){
                player.sendMessage(ChatColor.RED + "You cannot speak as you are muted permanently\n You were muted for: " + profile.getMostRecentPunishment(PunishmentType.MUTE).getReason());
            } else {
                player.sendMessage(ChatColor.RED + "You cannot speak as you are muted for " + TimeUtil.parseTime(System.currentTimeMillis() - profile.getMostRecentPunishment(PunishmentType.MUTE).getDuration()) + ".\n You were muted for " + profile.getMostRecentPunishment(PunishmentType.MUTE).getReason()) + ".");
            }
        }
    }
}

thank you
 
Have you confirmed from another account that everyone can see the message and not just you?

A lot of servers have a feature called "ghost mutes" which lets the muted person see messages they send but no one else
 
General Discussion
Back