Skip to content

Commit

Permalink
Fix being unable to set chat channels (#1088)
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <[email protected]>
  • Loading branch information
applenick authored Oct 30, 2022
1 parent 47eafaa commit c5d5298
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/tc/oc/pgm/listeners/ChatDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import static tc.oc.pgm.util.text.TextTranslations.translate;

import app.ashcon.intake.Command;
import app.ashcon.intake.parametric.annotation.Maybe;
import app.ashcon.intake.parametric.annotation.Text;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
Expand Down Expand Up @@ -116,7 +117,7 @@ public Set<UUID> getMutedUUIDs() {
aliases = {"g", "all"},
desc = "Send a message to everyone",
usage = "[message]")
public void sendGlobal(Match match, MatchPlayer sender, @Nullable @Text String message) {
public void sendGlobal(Match match, MatchPlayer sender, @Maybe @Text String message) {
if (sender != null && sender.isVanished()) {
sendAdmin(match, sender, message);
return;
Expand All @@ -138,7 +139,7 @@ public void sendGlobal(Match match, MatchPlayer sender, @Nullable @Text String m
aliases = {"t"},
desc = "Send a message to your team",
usage = "[message]")
public void sendTeam(Match match, MatchPlayer sender, @Nullable @Text String message) {
public void sendTeam(Match match, MatchPlayer sender, @Maybe @Text String message) {
if (sender != null && sender.isVanished()) {
sendAdmin(match, sender, message);
return;
Expand Down Expand Up @@ -172,7 +173,7 @@ public void sendTeam(Match match, MatchPlayer sender, @Nullable @Text String mes
desc = "Send a message to operators",
usage = "[message]",
perms = Permissions.ADMINCHAT)
public void sendAdmin(Match match, MatchPlayer sender, @Nullable @Text String message) {
public void sendAdmin(Match match, MatchPlayer sender, @Maybe @Text String message) {
// If a player managed to send a default message without permissions, reset their chat channel
if (sender != null && !sender.getBukkit().hasPermission(Permissions.ADMINCHAT)) {
sender.getSettings().resetValue(SettingKey.CHAT);
Expand Down

0 comments on commit c5d5298

Please sign in to comment.