Minor code householding

This commit is contained in:
ljacqu
2018-05-20 13:10:26 +02:00
parent 80dce1a92f
commit 8e4288f911
10 changed files with 48 additions and 46 deletions
@@ -1,5 +1,6 @@
package fr.xephi.authme.command.executable.authme;
import com.google.common.primitives.Ints;
import fr.xephi.authme.command.ExecutableCommand;
import fr.xephi.authme.task.purge.PurgeService;
import org.bukkit.ChatColor;
@@ -26,10 +27,8 @@ public class PurgeCommand implements ExecutableCommand {
String daysStr = arguments.get(0);
// Convert the days string to an integer value, and make sure it's valid
int days;
try {
days = Integer.parseInt(daysStr);
} catch (NumberFormatException ex) {
Integer days = Ints.tryParse(daysStr);
if (days == null) {
sender.sendMessage(ChatColor.RED + "The value you've entered is invalid!");
return;
}