parent
ca36515fc2
commit
5bdd5cca16
|
@ -1,10 +1,6 @@
|
||||||
package xyz.etztech.qol.commands;
|
package xyz.etztech.qol.commands;
|
||||||
|
|
||||||
import github.scarsz.discordsrv.DiscordSRV;
|
import github.scarsz.discordsrv.DiscordSRV;
|
||||||
import net.md_5.bungee.api.chat.ClickEvent;
|
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
@ -30,7 +26,7 @@ public class DiscordIgnoreCommand implements CommandExecutor {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!commandSender.hasPermission("qol.discord_ignore")) {
|
if (!commandSender.hasPermission("qol.discordignore")) {
|
||||||
EtzTechUtil.sms(commandSender, Lang.NO_PERMISSION.getDef());
|
EtzTechUtil.sms(commandSender, Lang.NO_PERMISSION.getDef());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -42,7 +38,7 @@ public class DiscordIgnoreCommand implements CommandExecutor {
|
||||||
|
|
||||||
Player player = (Player) commandSender;
|
Player player = (Player) commandSender;
|
||||||
|
|
||||||
Boolean ignoreState = player.hasMetadata(DISCORD_IGNORE_METADATA);
|
boolean ignoreState = player.hasMetadata(DISCORD_IGNORE_METADATA);
|
||||||
String msg;
|
String msg;
|
||||||
if (ignoreState) {
|
if (ignoreState) {
|
||||||
player.removeMetadata(DISCORD_IGNORE_METADATA, plugin);
|
player.removeMetadata(DISCORD_IGNORE_METADATA, plugin);
|
||||||
|
@ -50,7 +46,7 @@ public class DiscordIgnoreCommand implements CommandExecutor {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.setMetadata(DISCORD_IGNORE_METADATA, new FixedMetadataValue(plugin, DISCORD_IGNORE_METADATA));
|
player.setMetadata(DISCORD_IGNORE_METADATA, new FixedMetadataValue(plugin, DISCORD_IGNORE_METADATA));
|
||||||
msg = "Ignoring Discord messages";
|
msg = "Ignoring Discord messages.";
|
||||||
}
|
}
|
||||||
|
|
||||||
EtzTechUtil.sms(commandSender, org.bukkit.ChatColor.GREEN + msg);
|
EtzTechUtil.sms(commandSender, org.bukkit.ChatColor.GREEN + msg);
|
||||||
|
|
Loading…
Reference in New Issue