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;
|
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;
|
||||||
@ -21,6 +22,8 @@ public class Command_unlinkdiscord extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plugin.al.isAdmin(playerSender))
|
||||||
|
{
|
||||||
Admin admin = plugin.al.getAdmin(playerSender);
|
Admin admin = plugin.al.getAdmin(playerSender);
|
||||||
if (admin.getDiscordID() == null)
|
if (admin.getDiscordID() == null)
|
||||||
{
|
{
|
||||||
@ -31,4 +34,18 @@ public class Command_unlinkdiscord extends FreedomCommand
|
|||||||
msg("Your minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN);
|
msg("Your minecraft account has been successfully unlinked from the discord account.", ChatColor.GREEN);
|
||||||
return true;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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