mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Unlinkdiscord now works for ops
This commit is contained in:
parent
107d886b35
commit
b43a9b6749
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import org.bukkit.command.Command;
|
||||
@ -21,14 +22,30 @@ public class Command_unlinkdiscord extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
if (admin.getDiscordID() == null)
|
||||
if (plugin.al.isAdmin(playerSender))
|
||||
{
|
||||
msg("Your minecraft account is not linked to a discord account.", ChatColor.RED);
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
if (admin.getDiscordID() == null)
|
||||
{
|
||||
msg("Your minecraft account is not linked to a discord account.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
admin.setDiscordID(null);
|
||||
msg("Your minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
VPlayer data = plugin.pv.getVerificationPlayer(playerSender);
|
||||
if (data.getDiscordId() == null)
|
||||
{
|
||||
msg("Your minecraft account is not linked to a discord account.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
data.setDiscordId(null);
|
||||
data.setDiscordEnabled(false);
|
||||
msg("Your minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN);
|
||||
return true;
|
||||
}
|
||||
admin.setDiscordID(null);
|
||||
msg("Your minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||
public class Command_vanish extends FreedomCommand
|
||||
{
|
||||
public static ArrayList<Player> VANISHED = new ArrayList<Player>();
|
||||
public static ArrayList<Player> VANISHED = new ArrayList<>();
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole) {
|
||||
Displayable display = plugin.rm.getDisplay(playerSender);
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.config;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
Loading…
Reference in New Issue
Block a user