Stuff from the common floobits workspace

Author:    AuthMe-Team <AuthMeTeam@123NoEmail.com>
This commit is contained in:
AuthMe-Team
2015-11-23 20:20:42 +01:00
committed by Gabriele C
parent 69a09aec17
commit 9ec2d6d059
169 changed files with 5161 additions and 4806 deletions
@@ -5,7 +5,6 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* This event is call when a player try to /login
*
* @author Xephi59
@@ -13,12 +12,13 @@ import org.bukkit.event.HandlerList;
*/
public class AuthMeAsyncPreLoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Player player;
private boolean canLogin = true;
private static final HandlerList handlers = new HandlerList();
/**
* Constructor for AuthMeAsyncPreLoginEvent.
*
* @param player Player
*/
public AuthMeAsyncPreLoginEvent(Player player) {
@@ -28,22 +28,25 @@ public class AuthMeAsyncPreLoginEvent extends Event {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return player;
}
/**
* Method canLogin.
* @return boolean */
*
* @return boolean
*/
public boolean canLogin() {
return canLogin;
}
/**
* Method setCanLogin.
*
* @param canLogin boolean
*/
public void setCanLogin(boolean canLogin) {
@@ -52,8 +55,9 @@ public class AuthMeAsyncPreLoginEvent extends Event {
/**
* Method getHandlers.
* @return HandlerList */
*
* @return HandlerList
*/
@Override
public HandlerList getHandlers() {
return handlers;
@@ -4,7 +4,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
/**
*
* This event is call when AuthMe try to teleport a player
*
* @author Xephi59
@@ -18,8 +17,9 @@ public class AuthMeTeleportEvent extends CustomEvent {
/**
* Constructor for AuthMeTeleportEvent.
*
* @param player Player
* @param to Location
* @param to Location
*/
public AuthMeTeleportEvent(Player player, Location to) {
this.player = player;
@@ -29,32 +29,36 @@ public class AuthMeTeleportEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return player;
}
/**
* Method getTo.
*
* @return Location
*/
public Location getTo() {
return to;
}
/**
* Method setTo.
*
* @param to Location
*/
public void setTo(Location to) {
this.to = to;
}
/**
* Method getTo.
* @return Location */
public Location getTo() {
return to;
}
/**
* Method getFrom.
* @return Location */
*
* @return Location
*/
public Location getFrom() {
return from;
}
@@ -5,14 +5,13 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author Xephi59
* @version $Revision: 1.0 $
*/
public class CustomEvent extends Event implements Cancellable {
private boolean isCancelled;
private static final HandlerList handlers = new HandlerList();
private boolean isCancelled;
public CustomEvent() {
super(false);
@@ -20,42 +19,46 @@ public class CustomEvent extends Event implements Cancellable {
/**
* Constructor for CustomEvent.
*
* @param b boolean
*/
public CustomEvent(boolean b) {
super(b);
}
/**
* Method getHandlers.
* @return HandlerList */
public HandlerList getHandlers() {
return handlers;
}
/**
* Method getHandlerList.
* @return HandlerList */
*
* @return HandlerList
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Method getHandlers.
*
* @return HandlerList
*/
public HandlerList getHandlers() {
return handlers;
}
/**
* Method isCancelled.
* @return boolean * @see org.bukkit.event.Cancellable#isCancelled() */
*
* @return boolean * @see org.bukkit.event.Cancellable#isCancelled()
*/
public boolean isCancelled() {
return this.isCancelled;
}
/**
* Method setCancelled.
*
* @param cancelled boolean
* @see org.bukkit.event.Cancellable#setCancelled(boolean) */
* @see org.bukkit.event.Cancellable#setCancelled(boolean)
*/
public void setCancelled(boolean cancelled) {
this.isCancelled = cancelled;
}
@@ -4,7 +4,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
/**
*
* Called if a player is teleported to the authme first spawn
*
* @author Xephi59
@@ -18,9 +17,10 @@ public class FirstSpawnTeleportEvent extends CustomEvent {
/**
* Constructor for FirstSpawnTeleportEvent.
*
* @param player Player
* @param from Location
* @param to Location
* @param from Location
* @param to Location
*/
public FirstSpawnTeleportEvent(Player player, Location from, Location to) {
super(true);
@@ -31,32 +31,36 @@ public class FirstSpawnTeleportEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return player;
}
/**
* Method getTo.
*
* @return Location
*/
public Location getTo() {
return to;
}
/**
* Method setTo.
*
* @param to Location
*/
public void setTo(Location to) {
this.to = to;
}
/**
* Method getTo.
* @return Location */
public Location getTo() {
return to;
}
/**
* Method getFrom.
* @return Location */
*
* @return Location
*/
public Location getFrom() {
return from;
}
@@ -5,7 +5,6 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* This event is called when a player login or register through AuthMe. The
* boolean 'isLogin' will be false if, and only if, login/register failed.
*
@@ -14,13 +13,14 @@ import org.bukkit.event.HandlerList;
*/
public class LoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Player player;
private boolean isLogin;
private static final HandlerList handlers = new HandlerList();
/**
* Constructor for LoginEvent.
* @param player Player
*
* @param player Player
* @param isLogin boolean
*/
public LoginEvent(Player player, boolean isLogin) {
@@ -28,24 +28,45 @@ public class LoginEvent extends Event {
this.isLogin = isLogin;
}
/**
* Method getHandlerList.
*
* @return HandlerList
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return this.player;
}
/**
* Method setPlayer.
*
* @param player Player
*/
public void setPlayer(Player player) {
this.player = player;
}
/**
* Method isLogin.
*
* @return boolean
*/
public boolean isLogin() {
return isLogin;
}
/**
* Method setLogin.
*
* @param isLogin boolean
*/
@Deprecated
@@ -53,29 +74,14 @@ public class LoginEvent extends Event {
this.isLogin = isLogin;
}
/**
* Method isLogin.
* @return boolean */
public boolean isLogin() {
return isLogin;
}
/**
* Method getHandlers.
* @return HandlerList */
*
* @return HandlerList
*/
@Override
public HandlerList getHandlers() {
return handlers;
}
/**
* Method getHandlerList.
* @return HandlerList */
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -5,7 +5,6 @@ import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* This event is called when a player logout through AuthMe.
*
* @author Xephi59
@@ -13,27 +12,39 @@ import org.bukkit.event.HandlerList;
*/
public class LogoutEvent extends Event {
private Player player;
private static final HandlerList handlers = new HandlerList();
private Player player;
/**
* Constructor for LogoutEvent.
*
* @param player Player
*/
public LogoutEvent(Player player) {
this.player = player;
}
/**
* Method getHandlerList.
*
* @return HandlerList
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return this.player;
}
/**
* Method setPlayer.
*
* @param player Player
*/
public void setPlayer(Player player) {
@@ -42,19 +53,12 @@ public class LogoutEvent extends Event {
/**
* Method getHandlers.
* @return HandlerList */
*
* @return HandlerList
*/
@Override
public HandlerList getHandlers() {
return handlers;
}
/**
* Method getHandlerList.
* @return HandlerList */
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,20 +1,18 @@
package fr.xephi.authme.events;
import fr.xephi.authme.security.crypts.EncryptionMethod;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import fr.xephi.authme.security.crypts.EncryptionMethod;
/**
* <p>
* This event is called when we need to compare or get an hash password, for set
* a custom EncryptionMethod
* </p>
*
* @see fr.xephi.authme.security.crypts.EncryptionMethod
*
* @author Xephi59
* @version $Revision: 1.0 $
* @see fr.xephi.authme.security.crypts.EncryptionMethod
*/
public class PasswordEncryptionEvent extends Event {
@@ -24,7 +22,8 @@ public class PasswordEncryptionEvent extends Event {
/**
* Constructor for PasswordEncryptionEvent.
* @param method EncryptionMethod
*
* @param method EncryptionMethod
* @param playerName String
*/
public PasswordEncryptionEvent(EncryptionMethod method, String playerName) {
@@ -33,45 +32,50 @@ public class PasswordEncryptionEvent extends Event {
this.playerName = playerName;
}
/**
* Method getHandlerList.
*
* @return HandlerList
*/
public static HandlerList getHandlerList() {
return handlers;
}
/**
* Method getHandlers.
* @return HandlerList */
*
* @return HandlerList
*/
@Override
public HandlerList getHandlers() {
return handlers;
}
/**
* Method getMethod.
*
* @return EncryptionMethod
*/
public EncryptionMethod getMethod() {
return method;
}
/**
* Method setMethod.
*
* @param method EncryptionMethod
*/
public void setMethod(EncryptionMethod method) {
this.method = method;
}
/**
* Method getMethod.
* @return EncryptionMethod */
public EncryptionMethod getMethod() {
return method;
}
/**
* Method getPlayerName.
* @return String */
*
* @return String
*/
public String getPlayerName() {
return playerName;
}
/**
* Method getHandlerList.
* @return HandlerList */
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -4,7 +4,6 @@ import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
/**
*
* This event is call just after store inventory into cache and will empty the
* player inventory.
*
@@ -21,6 +20,7 @@ public class ProtectInventoryEvent extends CustomEvent {
/**
* Constructor for ProtectInventoryEvent.
*
* @param player Player
*/
public ProtectInventoryEvent(Player player) {
@@ -34,30 +34,34 @@ public class ProtectInventoryEvent extends CustomEvent {
/**
* Method getStoredInventory.
* @return ItemStack[] */
*
* @return ItemStack[]
*/
public ItemStack[] getStoredInventory() {
return this.storedinventory;
}
/**
* Method getStoredArmor.
* @return ItemStack[] */
*
* @return ItemStack[]
*/
public ItemStack[] getStoredArmor() {
return this.storedarmor;
}
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return this.player;
}
/**
* Method setNewInventory.
*
* @param emptyInventory ItemStack[]
*/
public void setNewInventory(ItemStack[] emptyInventory) {
@@ -66,14 +70,16 @@ public class ProtectInventoryEvent extends CustomEvent {
/**
* Method getEmptyInventory.
* @return ItemStack[] */
*
* @return ItemStack[]
*/
public ItemStack[] getEmptyInventory() {
return this.emptyInventory;
}
/**
* Method setNewArmor.
*
* @param emptyArmor ItemStack[]
*/
public void setNewArmor(ItemStack[] emptyArmor) {
@@ -82,8 +88,9 @@ public class ProtectInventoryEvent extends CustomEvent {
/**
* Method getEmptyArmor.
* @return ItemStack[] */
*
* @return ItemStack[]
*/
public ItemStack[] getEmptyArmor() {
return this.emptyArmor;
}
@@ -4,7 +4,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
/**
*
* This event is call if, and only if, a player is teleported just after a
* register.
*
@@ -19,8 +18,9 @@ public class RegisterTeleportEvent extends CustomEvent {
/**
* Constructor for RegisterTeleportEvent.
*
* @param player Player
* @param to Location
* @param to Location
*/
public RegisterTeleportEvent(Player player, Location to) {
this.player = player;
@@ -30,32 +30,36 @@ public class RegisterTeleportEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return player;
}
/**
* Method getTo.
*
* @return Location
*/
public Location getTo() {
return to;
}
/**
* Method setTo.
*
* @param to Location
*/
public void setTo(Location to) {
this.to = to;
}
/**
* Method getTo.
* @return Location */
public Location getTo() {
return to;
}
/**
* Method getFrom.
* @return Location */
*
* @return Location
*/
public Location getFrom() {
return from;
}
@@ -3,7 +3,6 @@ package fr.xephi.authme.events;
import org.bukkit.entity.Player;
/**
*
* This event is call when a creative inventory is reseted.
*
* @author Xephi59
@@ -15,6 +14,7 @@ public class ResetInventoryEvent extends CustomEvent {
/**
* Constructor for ResetInventoryEvent.
*
* @param player Player
*/
public ResetInventoryEvent(Player player) {
@@ -24,14 +24,16 @@ public class ResetInventoryEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return this.player;
}
/**
* Method setPlayer.
*
* @param player Player
*/
public void setPlayer(Player player) {
@@ -14,6 +14,7 @@ public class RestoreInventoryEvent extends CustomEvent {
/**
* Constructor for RestoreInventoryEvent.
*
* @param player Player
*/
public RestoreInventoryEvent(Player player) {
@@ -22,8 +23,9 @@ public class RestoreInventoryEvent extends CustomEvent {
/**
* Constructor for RestoreInventoryEvent.
*
* @param player Player
* @param async boolean
* @param async boolean
*/
public RestoreInventoryEvent(Player player, boolean async) {
super(async);
@@ -32,14 +34,16 @@ public class RestoreInventoryEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return this.player;
}
/**
* Method setPlayer.
*
* @param player Player
*/
public void setPlayer(Player player) {
@@ -4,7 +4,6 @@ import org.bukkit.Location;
import org.bukkit.entity.Player;
/**
*
* Called if a player is teleported to a specific spawn
*
* @author Xephi59
@@ -19,13 +18,14 @@ public class SpawnTeleportEvent extends CustomEvent {
/**
* Constructor for SpawnTeleportEvent.
* @param player Player
* @param from Location
* @param to Location
*
* @param player Player
* @param from Location
* @param to Location
* @param isAuthenticated boolean
*/
public SpawnTeleportEvent(Player player, Location from, Location to,
boolean isAuthenticated) {
boolean isAuthenticated) {
this.player = player;
this.from = from;
this.to = to;
@@ -34,40 +34,45 @@ public class SpawnTeleportEvent extends CustomEvent {
/**
* Method getPlayer.
* @return Player */
*
* @return Player
*/
public Player getPlayer() {
return player;
}
/**
* Method getTo.
*
* @return Location
*/
public Location getTo() {
return to;
}
/**
* Method setTo.
*
* @param to Location
*/
public void setTo(Location to) {
this.to = to;
}
/**
* Method getTo.
* @return Location */
public Location getTo() {
return to;
}
/**
* Method getFrom.
* @return Location */
*
* @return Location
*/
public Location getFrom() {
return from;
}
/**
* Method isAuthenticated.
* @return boolean */
*
* @return boolean
*/
public boolean isAuthenticated() {
return isAuthenticated;
}