Skip to content

Commit

Permalink
feat: add silence leave for premiumvanish (fixes #167)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChipWolf committed Feb 26, 2021
1 parent 3d52572 commit a89e9af
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,11 @@ public void onLogout(PlayerDisconnectEvent event) {

if ( ConfigManager.getInstance().getHandler("joinmessages.yml").getConfig().getBoolean("showquit") == true ) {

// PremiumVanish support, return as early as possible to avoid loading unnecessary resources
if (MultiChat.premiumVanish && MultiChat.hideVanishedStaffInLeave && BungeeVanishAPI.isInvisible(player)) {
return;
}

String joinformat = ConfigManager.getInstance().getHandler("joinmessages.yml").getConfig().getString("networkquit");
String silentformat = ConfigManager.getInstance().getHandler("joinmessages.yml").getConfig().getString("silentquit");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class MultiChat extends Plugin implements Listener {
public static boolean hideVanishedStaffInMsg = true;
public static boolean hideVanishedStaffInStaffList = true;
public static boolean hideVanishedStaffInJoin = true;
public static boolean hideVanishedStaffInLeave = true;

public static List<String> legacyServers = new ArrayList<String>();

Expand Down Expand Up @@ -383,6 +384,7 @@ public void onEnable() {
hideVanishedStaffInMsg = configYML.getBoolean("premium_vanish.prevent_message");
hideVanishedStaffInStaffList = configYML.getBoolean("premium_vanish.prevent_staff_list");
hideVanishedStaffInJoin = configYML.getBoolean("premium_vanish.silence_join");
hideVanishedStaffInLeave = configYML.getBoolean("premium_vanish.silence_leave");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public void execute(CommandSender sender, String[] args) {
MultiChat.hideVanishedStaffInMsg = ConfigManager.getInstance().getHandler("config.yml").getConfig().getSection("premium_vanish").getBoolean("prevent_message");
MultiChat.hideVanishedStaffInStaffList = ConfigManager.getInstance().getHandler("config.yml").getConfig().getSection("premium_vanish").getBoolean("prevent_staff_list");
MultiChat.hideVanishedStaffInJoin = ConfigManager.getInstance().getHandler("config.yml").getConfig().getSection("premium_vanish").getBoolean("silence_join");
MultiChat.hideVanishedStaffInLeave = ConfigManager.getInstance().getHandler("config.yml").getConfig().getSection("premium_vanish").getBoolean("silence_leave");
}

} else {
Expand Down
1 change: 1 addition & 0 deletions multichat/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ premium_vanish:
prevent_message: true # Prevent players being able to /msg vanished staff
prevent_staff_list: true # Prevent vanished staff showing up in /staff
silence_join: true # Prevent vanished players sending a join message
silence_leave: true # Prevent vanished players sending a leave message

# Legacy (PRE-1.16) Servers
# Listing servers here will mark them as 'LEGACY' servers
Expand Down
1 change: 1 addition & 0 deletions multichat/src/main/resources/config_fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ premium_vanish:
prevent_message: true # Bloquer l'utilisation de la commande /msg
prevent_staff_list: true # Masquer de la liste /staff
silence_join: true # Prevent vanished players sending a join message
silence_leave: true # Prevent vanished players sending a join message

# Legacy (PRE-1.16) Servers
# Listing servers here will mark them as 'LEGACY' servers
Expand Down

0 comments on commit a89e9af

Please sign in to comment.