Changed error outputs to use Utils class
This commit is contained in:
parent
e44654c8f0
commit
2562896d26
@ -11,7 +11,6 @@ import java.util.Map;
|
|||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,7 +31,7 @@ import com.redstoner.misc.mysql.elements.MysqlDatabase;
|
|||||||
import com.redstoner.misc.mysql.elements.MysqlTable;
|
import com.redstoner.misc.mysql.elements.MysqlTable;
|
||||||
import com.redstoner.modules.Module;
|
import com.redstoner.modules.Module;
|
||||||
|
|
||||||
@Version(major = 1, minor = 0, revision = 0, compatible = 1)
|
@Version(major = 1, minor = 0, revision = 1, compatible = 1)
|
||||||
public class Check implements Module, Listener
|
public class Check implements Module, Listener
|
||||||
{
|
{
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
@ -44,7 +43,7 @@ public class Check implements Module, Listener
|
|||||||
Map<Serializable, Serializable> config = JSONManager.getConfiguration("Check.json");
|
Map<Serializable, Serializable> config = JSONManager.getConfiguration("Check.json");
|
||||||
if (config == null || !config.containsKey("database") || !config.containsKey("table"))
|
if (config == null || !config.containsKey("database") || !config.containsKey("table"))
|
||||||
{
|
{
|
||||||
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Could not load the Check config file, disabling!");
|
Utils.sendErrorMessage(Bukkit.getConsoleSender(), null, "Could not load the Check config file, disabling!");
|
||||||
enabled = false;
|
enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -55,7 +54,7 @@ public class Check implements Module, Listener
|
|||||||
}
|
}
|
||||||
catch (NullPointerException e)
|
catch (NullPointerException e)
|
||||||
{
|
{
|
||||||
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Could not use the Check config, disabling!");
|
Utils.sendErrorMessage(Bukkit.getConsoleSender(), null, "Could not use the Check config, disabling!");
|
||||||
enabled = false;
|
enabled = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,9 @@ import org.bukkit.event.player.PlayerJoinEvent;
|
|||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
|
|
||||||
import com.nemez.cmdmgr.Command;
|
import com.nemez.cmdmgr.Command;
|
||||||
|
import com.redstoner.annotations.Version;
|
||||||
import com.redstoner.misc.Main;
|
import com.redstoner.misc.Main;
|
||||||
|
import com.redstoner.misc.Utils;
|
||||||
import com.redstoner.misc.mysql.JSONManager;
|
import com.redstoner.misc.mysql.JSONManager;
|
||||||
import com.redstoner.misc.mysql.MysqlHandler;
|
import com.redstoner.misc.mysql.MysqlHandler;
|
||||||
import com.redstoner.misc.mysql.elements.ConstraintOperator;
|
import com.redstoner.misc.mysql.elements.ConstraintOperator;
|
||||||
@ -30,6 +32,7 @@ import com.redstoner.misc.mysql.elements.MysqlTable;
|
|||||||
import com.redstoner.misc.mysql.types.text.VarChar;
|
import com.redstoner.misc.mysql.types.text.VarChar;
|
||||||
import com.redstoner.modules.Module;
|
import com.redstoner.modules.Module;
|
||||||
|
|
||||||
|
@Version(major = 1, minor = 0, revision = 1, compatible = 1)
|
||||||
public class LoginSecurity implements Module, Listener
|
public class LoginSecurity implements Module, Listener
|
||||||
{
|
{
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
@ -42,8 +45,8 @@ public class LoginSecurity implements Module, Listener
|
|||||||
Map<Serializable, Serializable> config = JSONManager.getConfiguration("LoginSecurity.json");
|
Map<Serializable, Serializable> config = JSONManager.getConfiguration("LoginSecurity.json");
|
||||||
if (config == null || !config.containsKey("database") || !config.containsKey("table"))
|
if (config == null || !config.containsKey("database") || !config.containsKey("table"))
|
||||||
{
|
{
|
||||||
Bukkit.getConsoleSender()
|
Utils.sendErrorMessage(Bukkit.getConsoleSender(), null,
|
||||||
.sendMessage(ChatColor.RED + "Could not load the LoginSecurity config file, disabling!");
|
"Could not load the LoginSecurity config file, disabling!");
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
@ -56,7 +59,8 @@ public class LoginSecurity implements Module, Listener
|
|||||||
}
|
}
|
||||||
catch (NullPointerException e)
|
catch (NullPointerException e)
|
||||||
{
|
{
|
||||||
Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Could not use the LoginSecurity config, disabling!");
|
Utils.sendErrorMessage(Bukkit.getConsoleSender(), null,
|
||||||
|
"Could not use the LoginSecurity config, disabling!");
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
loggingIn = new HashMap<>();
|
loggingIn = new HashMap<>();
|
||||||
|
Reference in New Issue
Block a user