Bug fixes (#92)

* Bug fixes

- Now checks if nothing was ejected
- Fix NPE in saconfig
- Module_permbans now checks if you are an admin

* Discord is better
This commit is contained in:
Telesphoreo
2018-07-24 22:54:00 -07:00
committed by Seth
parent c0b43f26ea
commit 113ab62f0b
6 changed files with 55 additions and 23 deletions

View File

@ -27,6 +27,12 @@ public class Command_eject extends FreedomCommand
names.add(entity.getName());
}
if (names.isEmpty())
{
msg("Nothing was ejected.", ChatColor.GREEN);
return true;
}
msg("Ejecting " + StringUtils.join(names, ", ") + ".", ChatColor.GREEN);
playerSender.eject();

View File

@ -32,7 +32,6 @@ public class Command_saconfig extends FreedomCommand
case "list":
{
msg("Admins: " + StringUtils.join(plugin.al.getAdminNames(), ", "), ChatColor.GOLD);
return true;
}
@ -154,6 +153,13 @@ public class Command_saconfig extends FreedomCommand
// Player already an admin?
final Player player = getPlayer(args[1]);
if (player == null)
{
msg(FreedomCommand.PLAYER_NOT_FOUND);
return true;
}
if (player != null && plugin.al.isAdmin(player))
{
msg("That player is already admin.");
@ -176,7 +182,7 @@ public class Command_saconfig extends FreedomCommand
{
if (plugin.mbl.isMasterBuilderImpostor(player))
{
msg("This player was labeled as a Master Builder imposter and is not an admin, therefore they can not be added to the admin list.", ChatColor.RED);
msg("This player was labeled as a Master Builder impostor and is not an admin, therefore they can not be added to the admin list.", ChatColor.RED);
return true;
}
if (player == null)
@ -296,5 +302,4 @@ public class Command_saconfig extends FreedomCommand
}
}
}
}

View File

@ -1,5 +1,6 @@
package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.ChatColor;
@ -17,6 +18,12 @@ public class Command_wipeflatlands extends FreedomCommand
{
plugin.sf.setSavedFlag("do_wipe_flatlands", true);
if (!ConfigEntry.FLATLANDS_GENERATE.getBoolean())
{
msg("Flatlands generation is disabled, therefore it cannot be wiped.");
return true;
}
FUtil.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);
if (plugin.wgb.isPluginEnabled())