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

Fix being unable to set chat channels #1088

Merged
merged 1 commit into from
Oct 30, 2022
Merged
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
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