don't crash on thisway typo lol
This commit is contained in:
parent
e3830643f6
commit
7d0914bd43
@ -209,9 +209,13 @@ public class ExampleBaritoneControl extends Behavior implements Helper {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (msg.toLowerCase().startsWith("thisway")) {
|
if (msg.toLowerCase().startsWith("thisway")) {
|
||||||
|
try {
|
||||||
Goal goal = GoalXZ.fromDirection(playerFeetAsVec(), player().rotationYaw, Double.parseDouble(msg.substring(7).trim()));
|
Goal goal = GoalXZ.fromDirection(playerFeetAsVec(), player().rotationYaw, Double.parseDouble(msg.substring(7).trim()));
|
||||||
PathingBehavior.INSTANCE.setGoal(goal);
|
PathingBehavior.INSTANCE.setGoal(goal);
|
||||||
logDirect("Goal: " + goal);
|
logDirect("Goal: " + goal);
|
||||||
|
} catch (NumberFormatException ex) {
|
||||||
|
logDirect("Error unable to parse '" + msg.substring(7).trim() + "' to a double.");
|
||||||
|
}
|
||||||
event.cancel();
|
event.cancel();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user