mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Make numeric regexes require at least one number to match.
This commit is contained in:
parent
55e0500bae
commit
243c5ea6ea
@ -92,7 +92,7 @@ public class PotionEffectParser
|
||||
private static PotionEffectType getType(String type) {
|
||||
PotionEffectType effect = null;
|
||||
|
||||
if (type.matches("[0-9]*")) {
|
||||
if (type.matches("[0-9]+")) {
|
||||
effect = PotionEffectType.getById(Integer.parseInt(type));
|
||||
} else {
|
||||
effect = PotionEffectType.getByName(type.toUpperCase());
|
||||
@ -104,7 +104,7 @@ public class PotionEffectParser
|
||||
private static int getDuration(String duration) {
|
||||
int dur = -1;
|
||||
|
||||
if (duration.matches("[0-9]*")) {
|
||||
if (duration.matches("[0-9]+")) {
|
||||
dur = Integer.parseInt(duration);
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ public class PotionEffectParser
|
||||
private static int getAmplification(String amplifier) {
|
||||
int amp = -1;
|
||||
|
||||
if (amplifier.matches("[0-9]*")) {
|
||||
if (amplifier.matches("[0-9]+")) {
|
||||
amp = Integer.parseInt(amplifier);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user