Permalink
Browse files

Fixed a bug in location parsing for BounceBlocks.

  • Loading branch information...
me4502 committed Feb 27, 2017
1 parent a38c986 commit 18e505912e524c545c2731ec26980c8cc091f2e5
Showing with 7 additions and 8 deletions.
  1. +7 −8 src/main/java/com/sk89q/craftbook/mechanics/BounceBlocks.java
@@ -167,14 +167,13 @@ public void onSignChange(SignChangeEvent event) {
try {
String[] bits = RegexUtil.COMMA_PATTERN.split(StringUtils.replace(event.getLine(2), "!", ""));
- if(bits.length == 0)
- if(bits.length == 1)
- Double.parseDouble(bits[0]);
- else {
- Double.parseDouble(bits[0]);
- Double.parseDouble(bits[1]);
- Double.parseDouble(bits[2]);
- }
+ if (bits.length == 1) {
+ Double.parseDouble(bits[0]);
+ } else if (bits.length > 1) {
+ Double.parseDouble(bits[0]);
+ Double.parseDouble(bits[1]);
+ Double.parseDouble(bits[2]);
+ }
} catch(Exception e){
lplayer.printError("mech.bounceblocks.invalid-velocity");
SignUtil.cancelSign(event);

0 comments on commit 18e5059

Please sign in to comment.