Permalink
Browse files

Fixed bounceblock empty sign errors.

  • Loading branch information...
me4502 committed Feb 22, 2017
1 parent b654a39 commit 3db76312e9e94f4b394bb93f717431530bfe5025
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/main/java/com/sk89q/craftbook/mechanics/BounceBlocks.java
@@ -90,15 +90,19 @@ public void onPlayerMove(final PlayerMoveEvent event) {
CraftBookPlugin.logDebugMessage("Jump sign found where player jumped!", "bounce-blocks");
- double x = 0,y = 0,z = 0;
+ double x = 0,y,z = 0;
boolean straight = s.getLine(2).startsWith("!");
String[] bits = RegexUtil.COMMA_PATTERN.split(StringUtils.replace(s.getLine(2), "!", ""));
- if(bits.length == 0)
+ if (bits.length == 0) {
y = 0.5;
- if(bits.length == 1)
- y = Double.parseDouble(bits[0]);
- else {
+ } if (bits.length == 1) {
+ try {
+ y = Double.parseDouble(bits[0]);
+ } catch (NumberFormatException e) {
+ y = 0.5;
+ }
+ } else {
x = Double.parseDouble(bits[0]);
y = Double.parseDouble(bits[1]);
z = Double.parseDouble(bits[2]);

0 comments on commit 3db7631

Please sign in to comment.