From f8f214ca90f5065a60ac8c435f293d1b1e2bee95 Mon Sep 17 00:00:00 2001 From: Brady Date: Thu, 26 Sep 2019 18:52:29 -0500 Subject: [PATCH] Fix some null substitutions --- .../api/utils/command/datatypes/RelativeGoalBlock.java | 4 ++++ .../baritone/api/utils/command/datatypes/RelativeGoalXZ.java | 4 ++++ .../api/utils/command/datatypes/RelativeGoalYLevel.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalBlock.java b/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalBlock.java index a1ca7cf4..cd1c0be1 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalBlock.java +++ b/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalBlock.java @@ -30,6 +30,10 @@ public enum RelativeGoalBlock implements IDatatypePost { @Override public GoalXZ apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException { + if (origin == null) { + origin = BetterBlockPos.ORIGIN; + } + final ArgConsumer consumer = ctx.getConsumer(); return new GoalXZ( MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)), diff --git a/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalYLevel.java b/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalYLevel.java index e383f181..a8a9b232 100644 --- a/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalYLevel.java +++ b/src/api/java/baritone/api/utils/command/datatypes/RelativeGoalYLevel.java @@ -30,6 +30,10 @@ public enum RelativeGoalYLevel implements IDatatypePost