Error message on non-numerical input when parsing Vector3f
This commit is contained in:
parent
ebadad7cce
commit
9030d90bbd
1 changed files with 8 additions and 4 deletions
|
@ -15,9 +15,13 @@ public class Vector3fParser extends ParserType<Vector3f> {
|
|||
|
||||
@Override
|
||||
public Vector3f parse(Deque<String> deque) throws CommandExecutionException {
|
||||
return new Vector3f(
|
||||
Float.parseFloat(deque.pop()),
|
||||
Float.parseFloat(deque.pop()),
|
||||
Float.parseFloat(deque.pop()));
|
||||
try {
|
||||
return new Vector3f(
|
||||
Float.parseFloat(deque.pop()),
|
||||
Float.parseFloat(deque.pop()),
|
||||
Float.parseFloat(deque.pop()));
|
||||
} catch (NumberFormatException e) {
|
||||
throw new CommandExecutionException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue