mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 02:05:41 +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;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -20,15 +21,31 @@ public class Command_unlinkdiscord extends FreedomCommand
|
|||||||
msg("The discord verification system is currently disabled.", ChatColor.RED);
|
msg("The discord verification system is currently disabled.", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Admin admin = plugin.al.getAdmin(playerSender);
|
if (plugin.al.isAdmin(playerSender))
|
||||||
if (admin.getDiscordID() == null)
|
|
||||||
{
|
{
|
||||||
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;
|
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")
|
@CommandParameters(description = "Vanish/unvanish yourself.", usage = "/<command> [-s[ilent]]", aliases = "v")
|
||||||
public class Command_vanish extends FreedomCommand
|
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) {
|
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);
|
Displayable display = plugin.rm.getDisplay(playerSender);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.config;
|
package me.totalfreedom.totalfreedommod.config;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
|
Loading…
Reference in New Issue
Block a user