fix cache, still not add null check.

This commit is contained in:
DNx5 2015-09-14 03:45:09 +07:00
parent b4124bc46d
commit a4fd60a6f6
2 changed files with 14 additions and 23 deletions

View File

@ -11,8 +11,7 @@ public class DataFileCache {
private boolean flying;
public DataFileCache(ItemStack[] inventory, ItemStack[] armor) {
this.inventory = inventory;
this.armor = armor;
this(inventory, armor, "", false, false);
}
public DataFileCache(ItemStack[] inventory, ItemStack[] armor,

View File

@ -1,15 +1,14 @@
package fr.xephi.authme.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.security.RandomString;
import fr.xephi.authme.settings.Messages;
import fr.xephi.authme.settings.Settings;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class RegisterCommand implements CommandExecutor {
@ -23,26 +22,23 @@ public class RegisterCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmnd, String label,
String[] args) {
String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Player Only! Use 'authme register <playername> <password>' instead");
return true;
}
if (args.length == 0) {
m.send(sender, "usage_reg");
}
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
m.send(sender, "no_perm");
final Player player = (Player) sender;
if (args.length == 0 || (Settings.getEnablePasswordVerifier && args.length < 2)) {
m.send(player, "usage_reg");
return true;
}
if (!plugin.authmePermissible(player, "authme." + label.toLowerCase())) {
m.send(player, "no_perm");
return true;
}
final Player player = (Player) sender;
if (Settings.emailRegistration && !Settings.getmailAccount.isEmpty()) {
if (Settings.doubleEmailCheck) {
if (args.length < 2) {
m.send(player, "usage_reg");
return true;
}
if (!args[0].equals(args[1])) {
if (args.length < 2 || !args[0].equals(args[1])) {
m.send(player, "usage_reg");
return true;
}
@ -57,10 +53,6 @@ public class RegisterCommand implements CommandExecutor {
plugin.management.performRegister(player, thePass, email);
return true;
}
if (args.length == 0 || (Settings.getEnablePasswordVerifier && args.length < 2)) {
m.send(player, "usage_reg");
return true;
}
if (args.length > 1 && Settings.getEnablePasswordVerifier)
if (!args[0].equals(args[1])) {
m.send(player, "password_error");