- Avoid creating the same object over and over; instead keep it and only change it on settings reload
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package fr.xephi.authme.events;
|
||||
|
||||
import fr.xephi.authme.security.crypts.EncryptionMethod;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
@@ -13,22 +12,19 @@ public class PasswordEncryptionEvent extends CustomEvent {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private EncryptionMethod method;
|
||||
private String playerName;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param method The method used to encrypt the password
|
||||
* @param playerName The name of the player
|
||||
*/
|
||||
public PasswordEncryptionEvent(EncryptionMethod method, String playerName) {
|
||||
public PasswordEncryptionEvent(EncryptionMethod method) {
|
||||
super(false);
|
||||
this.method = method;
|
||||
this.playerName = playerName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of handlers, equivalent to {@link #getHandlers()} and required by {@link Event}.
|
||||
* Return the list of handlers, equivalent to {@link #getHandlers()} and required by {@link org.bukkit.event.Event}.
|
||||
*
|
||||
* @return The list of handlers
|
||||
*/
|
||||
@@ -58,14 +54,4 @@ public class PasswordEncryptionEvent extends CustomEvent {
|
||||
public void setMethod(EncryptionMethod method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the player the event has been fired for.
|
||||
*
|
||||
* @return The player name
|
||||
*/
|
||||
public String getPlayerName() {
|
||||
return playerName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user