Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Integrations: add plasmo voice connection check
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Jul 16, 2023
1 parent 482e0a7 commit 3b82f46
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ public class FlectonePlasmoVoice {

public static void mute(boolean unmute, String player, String time, String reason){
if(unmute) unmute(player);
try {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "vmute " + player + " " + time + " " + reason);
} catch (CommandException exception){
Main.warning("Failed to connect to Plasmo Voice");
}
executeCommand("vmute " + player + " " + time + " " + reason);
}

public static void unmute(String player){
executeCommand("vunmute " + player);
}

private static void executeCommand(String command){
try {
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "vunmute " + player);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
} catch (CommandException exception){
Main.warning("Failed to connect to Plasmo Voice");
}

}
}

0 comments on commit 3b82f46

Please sign in to comment.