If empty integer make it 0

This commit is contained in:
Brianna 2019-06-03 21:40:18 -04:00
parent 51200ddb07
commit cb815445e1

View File

@ -9,6 +9,6 @@ import java.util.function.BiConsumer;
public class IntegerIcon extends StringIcon {
public IntegerIcon(EpicVouchers instance, String string, int current, BiConsumer<Player, Integer> consumer) {
super(instance, Material.IRON_INGOT, string, "" + current, (player, edited) -> consumer.accept(player, Integer.parseInt(edited)), StringUtils::isNumeric);
super(instance, Material.IRON_INGOT, string, String.valueOf(current), (player, edited) -> consumer.accept(player, edited.equals("") ? 0 : Integer.parseInt(edited)), StringUtils::isNumeric);
}
}