Set classes to use Messages getter in plugin instance.

This commit is contained in:
DNx5
2015-11-26 08:17:19 +07:00
parent 0601ab0e40
commit 2de0e0e819
31 changed files with 76 additions and 60 deletions
@@ -23,12 +23,12 @@ public class AsyncChangeEmail {
private final Messages m;
public AsyncChangeEmail(Player player, AuthMe plugin, String oldEmail, String newEmail, String newEmailVerify) {
this.m = plugin.getMessages();
this.player = player;
this.plugin = plugin;
this.oldEmail = oldEmail;
this.newEmail = newEmail;
this.newEmailVerify = newEmailVerify;
this.m = Messages.getInstance();
}
public AsyncChangeEmail(Player player, AuthMe plugin, String oldEmail, String newEmail) {
@@ -40,12 +40,12 @@ public class AsynchronousJoin {
private final BukkitScheduler sched;
public AsynchronousJoin(Player player, AuthMe plugin, DataSource database) {
this.m = plugin.getMessages();
this.player = player;
this.plugin = plugin;
this.sched = plugin.getServer().getScheduler();
this.database = database;
this.name = player.getName().toLowerCase();
this.m = Messages.getInstance();
}
public void process() {
@@ -33,7 +33,7 @@ public class AsynchronousLogin {
protected final boolean forceLogin;
private final AuthMe plugin;
private final DataSource database;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for AsynchronousLogin.
@@ -44,12 +44,12 @@ public class AsynchronousLogin {
* @param plugin AuthMe
* @param data DataSource
*/
public AsynchronousLogin(Player player, String password, boolean forceLogin,
AuthMe plugin, DataSource data) {
public AsynchronousLogin(Player player, String password, boolean forceLogin, AuthMe plugin, DataSource data) {
this.m = plugin.getMessages();
this.player = player;
this.name = player.getName().toLowerCase();
this.password = password;
name = player.getName().toLowerCase();
realName = player.getName();
this.realName = player.getName();
this.forceLogin = forceLogin;
this.plugin = plugin;
this.database = data;
@@ -20,7 +20,7 @@ public class AsynchronousLogout {
protected final AuthMe plugin;
protected final DataSource database;
protected boolean canLogout = true;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for AsynchronousLogout.
@@ -29,8 +29,8 @@ public class AsynchronousLogout {
* @param plugin AuthMe
* @param database DataSource
*/
public AsynchronousLogout(Player player, AuthMe plugin,
DataSource database) {
public AsynchronousLogout(Player player, AuthMe plugin, DataSource database) {
this.m = plugin.getMessages();
this.player = player;
this.plugin = plugin;
this.database = database;
@@ -22,7 +22,7 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
protected final Player player;
protected final AuthMe plugin;
protected final String name;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for ProcessSyncronousPlayerLogout.
@@ -31,6 +31,7 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
* @param plugin AuthMe
*/
public ProcessSyncronousPlayerLogout(Player player, AuthMe plugin) {
this.m = plugin.getMessages();
this.player = player;
this.plugin = plugin;
this.name = player.getName().toLowerCase();
@@ -23,7 +23,7 @@ public class AsyncRegister {
protected String email = "";
private final AuthMe plugin;
private final DataSource database;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for AsyncRegister.
@@ -34,11 +34,11 @@ public class AsyncRegister {
* @param plugin AuthMe
* @param data DataSource
*/
public AsyncRegister(Player player, String password, String email,
AuthMe plugin, DataSource data) {
public AsyncRegister(Player player, String password, String email, AuthMe plugin, DataSource data) {
this.m = plugin.getMessages();
this.player = player;
this.password = password;
name = player.getName().toLowerCase();
this.name = player.getName().toLowerCase();
this.email = email;
this.plugin = plugin;
this.database = data;
@@ -20,7 +20,7 @@ public class ProcessSyncEmailRegister implements Runnable {
protected final Player player;
protected final String name;
private final AuthMe plugin;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for ProcessSyncEmailRegister.
@@ -29,6 +29,7 @@ public class ProcessSyncEmailRegister implements Runnable {
* @param plugin AuthMe
*/
public ProcessSyncEmailRegister(Player player, AuthMe plugin) {
this.m = plugin.getMessages();
this.player = player;
this.name = player.getName().toLowerCase();
this.plugin = plugin;
@@ -25,7 +25,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
protected final Player player;
protected final String name;
private final AuthMe plugin;
private final Messages m = Messages.getInstance();
private final Messages m;
/**
* Constructor for ProcessSyncronousPasswordRegister.
@@ -34,6 +34,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
* @param plugin AuthMe
*/
public ProcessSyncronousPasswordRegister(Player player, AuthMe plugin) {
this.m = plugin.getMessages();
this.player = player;
this.name = player.getName().toLowerCase();
this.plugin = plugin;
@@ -29,7 +29,7 @@ public class AsynchronousUnregister {
protected final String password;
protected final boolean force;
private final AuthMe plugin;
private final Messages m = Messages.getInstance();
private final Messages m;
private final JsonCache playerCache;
/**
@@ -40,12 +40,12 @@ public class AsynchronousUnregister {
* @param force boolean
* @param plugin AuthMe
*/
public AsynchronousUnregister(Player player, String password,
boolean force, AuthMe plugin) {
public AsynchronousUnregister(Player player, String password, boolean force, AuthMe plugin) {
this.m = plugin.getMessages();
this.player = player;
this.name = player.getName().toLowerCase();
this.password = password;
this.force = force;
name = player.getName().toLowerCase();
this.plugin = plugin;
this.playerCache = new JsonCache();
}