Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add silent flag to alert toggles #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions src/main/java/ac/grim/grimac/api/alerts/AlertManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,55 @@ public interface AlertManager {

/**
* Checks if the player has alerts enabled.
*
* @param player
* @return boolean
*/
boolean hasAlertsEnabled(Player player);

/**
* Toggles alerts for the player.
*
* @param player
*/
void toggleAlerts(Player player);
default void toggleAlerts(Player player) {
toggleAlerts(player, false);
}

/**
* Toggles alerts for the player.
*
* @param player
* @param silent - if set to true, the player won't be notified about the action
*/
void toggleAlerts(Player player, boolean silent);

/**
* Checks if the player has verbose enabled.
*
* @param player
* @return boolean
*/
boolean hasVerboseEnabled(Player player);

/**
* Toggles verbose for the player.
*
* @param player
*/
void toggleVerbose(Player player);
default void toggleVerbose(Player player) {
toggleVerbose(player, false);
}

/**
* Toggles verbose for the player.
*
* @param player
* @param silent - if set to true, the player won't be notified about the action
*/
void toggleVerbose(Player player, boolean silent);

boolean hasBrandsEnabled(Player player);

void toggleBrands(Player player, boolean silent);
}