Small tweaks

+ Fixed permission node
+ Removed unused imports
pull/17/head
Joey Hines 2021-08-02 19:28:13 -06:00
parent ca36515fc2
commit 5bdd5cca16
No known key found for this signature in database
GPG Key ID: 80F567B5C968F91B
1 changed files with 3 additions and 7 deletions

View File

@ -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);