mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
This commit is contained in:
parent
0adee3582b
commit
a3837a0e06
@ -47,43 +47,40 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
|
|
||||||
final Player player = getPlayer(args[1]);
|
final Player player = getPlayer(args[1]);
|
||||||
|
|
||||||
PlayerData data;
|
PlayerData data = player != null ? plugin.pl.getData(player) : plugin.pl.getData(args[1]);
|
||||||
|
|
||||||
if (player == null)
|
if (data == null)
|
||||||
{
|
{
|
||||||
data = plugin.pl.getData(args[1]);
|
msg(PLAYER_NOT_FOUND, ChatColor.RED);
|
||||||
if (data == null)
|
return true;
|
||||||
{
|
|
||||||
msg(PLAYER_NOT_FOUND);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
data = plugin.pl.getData(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.isMasterBuilder() && plugin.pl.isPlayerImpostor(player))
|
if (data.isMasterBuilder() && plugin.pl.isPlayerImpostor(player))
|
||||||
{
|
{
|
||||||
FUtil.staffAction(sender.getName(), "Re-adding " + player.getName() + " to the Master Builder list", true);
|
FUtil.staffAction(sender.getName(), "Re-adding " + data.getName() + " to the Master Builder list", true);
|
||||||
player.setOp(true);
|
|
||||||
player.sendMessage(YOU_ARE_OP);
|
|
||||||
|
|
||||||
if (plugin.pl.getPlayer(player).getFreezeData().isFrozen())
|
if (plugin.pl.getPlayer(player).getFreezeData().isFrozen())
|
||||||
{
|
{
|
||||||
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
||||||
player.sendMessage(ChatColor.GRAY + "You have been unfrozen.");
|
|
||||||
}
|
}
|
||||||
plugin.pl.verify(player, null);
|
if (player != null)
|
||||||
plugin.rm.updateDisplay(player);
|
{
|
||||||
|
plugin.pl.verify(player, null);
|
||||||
|
plugin.rm.updateDisplay(player);
|
||||||
|
player.setOp(true);
|
||||||
|
player.sendMessage(YOU_ARE_OP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (!data.isMasterBuilder())
|
else if (!data.isMasterBuilder())
|
||||||
{
|
{
|
||||||
FUtil.staffAction(sender.getName(), "Adding " + player.getName() + " to the Master Builder list", true);
|
FUtil.staffAction(sender.getName(), "Adding " + data.getName() + " to the Master Builder list", true);
|
||||||
data.setMasterBuilder(true);
|
data.setMasterBuilder(true);
|
||||||
data.setVerification(true);
|
data.setVerification(true);
|
||||||
plugin.pl.save(data);
|
plugin.pl.save(data);
|
||||||
plugin.rm.updateDisplay(player);
|
if (player != null)
|
||||||
|
{
|
||||||
|
plugin.rm.updateDisplay(player);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -105,9 +102,9 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player player = getPlayer(args[1]);
|
Player player = getPlayer(args[1]);
|
||||||
PlayerData data = plugin.pl.getData(player);
|
PlayerData data = player != null ? plugin.pl.getData(player) : plugin.pl.getData(args[1]);
|
||||||
|
|
||||||
if (!data.isMasterBuilder())
|
if (data == null || !data.isMasterBuilder())
|
||||||
{
|
{
|
||||||
msg("Master Builder not found: " + args[1]);
|
msg("Master Builder not found: " + args[1]);
|
||||||
return true;
|
return true;
|
||||||
@ -120,7 +117,10 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
data.setVerification(false);
|
data.setVerification(false);
|
||||||
}
|
}
|
||||||
plugin.pl.save(data);
|
plugin.pl.save(data);
|
||||||
plugin.rm.updateDisplay(player);
|
if (player != null)
|
||||||
|
{
|
||||||
|
plugin.rm.updateDisplay(player);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -130,6 +130,7 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||||
{
|
{
|
||||||
@ -139,17 +140,15 @@ public class Command_mbconfig extends FreedomCommand
|
|||||||
}
|
}
|
||||||
else if (args.length == 2)
|
else if (args.length == 2)
|
||||||
{
|
{
|
||||||
if (args[0].equals("add"))
|
if (args[0].equalsIgnoreCase("add"))
|
||||||
{
|
{
|
||||||
return FUtil.getPlayerList();
|
return FUtil.getPlayerList();
|
||||||
}
|
}
|
||||||
else if (args[0].equals("remove"))
|
else if (args[0].equalsIgnoreCase("remove") || args[0].equalsIgnoreCase("list"))
|
||||||
{
|
{
|
||||||
return plugin.pl.getMasterBuilderNames();
|
return plugin.pl.getMasterBuilderNames();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ public class Command_slconfig extends FreedomCommand
|
|||||||
|
|
||||||
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
if (plugin.dc.enabled && ConfigEntry.DISCORD_ROLE_SYNC.getBoolean())
|
||||||
{
|
{
|
||||||
plugin.dc.syncRoles(staffMember, plugin.pl.getData(staffMember.getName()).getDiscordID());
|
Discord.syncRoles(staffMember, plugin.pl.getData(staffMember.getName()).getDiscordID());
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.ptero.updateAccountStatus(staffMember);
|
plugin.ptero.updateAccountStatus(staffMember);
|
||||||
|
Loading…
Reference in New Issue
Block a user