Code Refactor - Whitespace Refactor
This commit is contained in:
@@ -4,31 +4,35 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class AuthMeTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
|
||||
public AuthMeTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
public AuthMeTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,33 +6,33 @@ import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class CustomEvent extends Event implements Cancellable {
|
||||
|
||||
private boolean isCancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static Server s;
|
||||
private boolean isCancelled;
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static Server s;
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
public boolean isCancelled() {
|
||||
return this.isCancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.isCancelled = cancelled;
|
||||
}
|
||||
|
||||
public static Server getServer() {
|
||||
return s;
|
||||
}
|
||||
public static Server getServer() {
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,51 +4,52 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class ProtectInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] storedinventory;
|
||||
private ItemStack[] storedarmor;
|
||||
private ItemStack[] emptyInventory = null;
|
||||
private ItemStack[] emptyArmor = null;
|
||||
private Player player;
|
||||
private ItemStack[] storedinventory;
|
||||
private ItemStack[] storedarmor;
|
||||
private ItemStack[] emptyInventory = null;
|
||||
private ItemStack[] emptyArmor = null;
|
||||
private Player player;
|
||||
|
||||
public ProtectInventoryEvent(Player player, ItemStack[] storedinventory, ItemStack[] storedarmor) {
|
||||
this.player = player;
|
||||
this.storedinventory = storedinventory;
|
||||
this.storedarmor = storedarmor;
|
||||
this.emptyInventory = new ItemStack[36];
|
||||
this.emptyArmor = new ItemStack[4];
|
||||
}
|
||||
public ProtectInventoryEvent(Player player, ItemStack[] storedinventory,
|
||||
ItemStack[] storedarmor) {
|
||||
this.player = player;
|
||||
this.storedinventory = storedinventory;
|
||||
this.storedarmor = storedarmor;
|
||||
this.emptyInventory = new ItemStack[36];
|
||||
this.emptyArmor = new ItemStack[4];
|
||||
}
|
||||
|
||||
public ItemStack[] getStoredInventory() {
|
||||
return this.storedinventory;
|
||||
}
|
||||
public ItemStack[] getStoredInventory() {
|
||||
return this.storedinventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getStoredArmor() {
|
||||
return this.storedarmor;
|
||||
}
|
||||
public ItemStack[] getStoredArmor() {
|
||||
return this.storedarmor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setNewInventory(ItemStack[] emptyInventory) {
|
||||
this.emptyInventory = emptyInventory;
|
||||
}
|
||||
public void setNewInventory(ItemStack[] emptyInventory) {
|
||||
this.emptyInventory = emptyInventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getEmptyInventory() {
|
||||
return this.emptyInventory;
|
||||
}
|
||||
public ItemStack[] getEmptyInventory() {
|
||||
return this.emptyInventory;
|
||||
}
|
||||
|
||||
public void setNewArmor(ItemStack[] emptyArmor) {
|
||||
this.emptyArmor = emptyArmor;
|
||||
}
|
||||
public void setNewArmor(ItemStack[] emptyArmor) {
|
||||
this.emptyArmor = emptyArmor;
|
||||
}
|
||||
|
||||
public ItemStack[] getEmptyArmor() {
|
||||
return this.emptyArmor;
|
||||
}
|
||||
public ItemStack[] getEmptyArmor() {
|
||||
return this.emptyArmor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,31 +4,35 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class RegisterTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
|
||||
public RegisterTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
public RegisterTeleportEvent(Player player, Location to) {
|
||||
this.player = player;
|
||||
this.from = player.getLocation();
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,23 +3,23 @@ package fr.xephi.authme.events;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class ResetInventoryEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Player player;
|
||||
|
||||
public ResetInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public ResetInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,43 +4,44 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class RestoreInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
|
||||
public RestoreInventoryEvent(Player player, ItemStack[] inventory, ItemStack[] armor) {
|
||||
this.player = player;
|
||||
this.inventory = inventory;
|
||||
this.armor = armor;
|
||||
}
|
||||
public RestoreInventoryEvent(Player player, ItemStack[] inventory,
|
||||
ItemStack[] armor) {
|
||||
this.player = player;
|
||||
this.inventory = inventory;
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,29 +3,29 @@ package fr.xephi.authme.events;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class SessionEvent extends CustomEvent {
|
||||
|
||||
private PlayerAuth player;
|
||||
private boolean isLogin;
|
||||
private PlayerAuth player;
|
||||
private boolean isLogin;
|
||||
|
||||
public SessionEvent(PlayerAuth auth, boolean isLogin) {
|
||||
this.player = auth;
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
public SessionEvent(PlayerAuth auth, boolean isLogin) {
|
||||
this.player = auth;
|
||||
this.isLogin = isLogin;
|
||||
}
|
||||
|
||||
public PlayerAuth getPlayerAuth() {
|
||||
return this.player;
|
||||
}
|
||||
public PlayerAuth getPlayerAuth() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(PlayerAuth player) {
|
||||
this.player = player;
|
||||
}
|
||||
public void setPlayer(PlayerAuth player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public boolean isLogin() {
|
||||
return isLogin;
|
||||
}
|
||||
public boolean isLogin() {
|
||||
return isLogin;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,36 +4,42 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class SpawnTeleportEvent extends CustomEvent {
|
||||
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
private boolean isAuthenticated;
|
||||
private Player player;
|
||||
private Location to;
|
||||
private Location from;
|
||||
private boolean isAuthenticated;
|
||||
|
||||
public SpawnTeleportEvent(Player player, Location from, Location to, boolean isAuthenticated) {
|
||||
this.player = player;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.isAuthenticated = isAuthenticated;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
public boolean isAuthenticated() {
|
||||
return isAuthenticated;
|
||||
}
|
||||
public SpawnTeleportEvent(Player player, Location from, Location to,
|
||||
boolean isAuthenticated) {
|
||||
this.player = player;
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.isAuthenticated = isAuthenticated;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public void setTo(Location to) {
|
||||
this.to = to;
|
||||
}
|
||||
|
||||
public Location getTo() {
|
||||
return to;
|
||||
}
|
||||
|
||||
public Location getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public boolean isAuthenticated() {
|
||||
return isAuthenticated;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,51 +5,52 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import fr.xephi.authme.cache.backup.FileCache;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
*
|
||||
* @author Xephi59
|
||||
*/
|
||||
public class StoreInventoryEvent extends CustomEvent {
|
||||
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
private ItemStack[] inventory;
|
||||
private ItemStack[] armor;
|
||||
private Player player;
|
||||
|
||||
public StoreInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
this.inventory = player.getInventory().getContents();
|
||||
this.armor = player.getInventory().getArmorContents();
|
||||
}
|
||||
public StoreInventoryEvent(Player player) {
|
||||
this.player = player;
|
||||
this.inventory = player.getInventory().getContents();
|
||||
this.armor = player.getInventory().getArmorContents();
|
||||
}
|
||||
|
||||
public StoreInventoryEvent(Player player, FileCache fileCache) {
|
||||
this.player = player;
|
||||
this.inventory = fileCache.readCache(player.getName().toLowerCase()).getInventory();
|
||||
this.armor = fileCache.readCache(player.getName().toLowerCase()).getArmour();
|
||||
}
|
||||
public StoreInventoryEvent(Player player, FileCache fileCache) {
|
||||
this.player = player;
|
||||
this.inventory = fileCache.readCache(player.getName().toLowerCase())
|
||||
.getInventory();
|
||||
this.armor = fileCache.readCache(player.getName().toLowerCase())
|
||||
.getArmour();
|
||||
}
|
||||
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
public ItemStack[] getInventory() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
public void setInventory(ItemStack[] inventory) {
|
||||
this.inventory = inventory;
|
||||
}
|
||||
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
public ItemStack[] getArmor() {
|
||||
return this.armor;
|
||||
}
|
||||
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
public void setArmor(ItemStack[] armor) {
|
||||
this.armor = armor;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
public void setPlayer(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user