Fix some null substitutions
This commit is contained in:
parent
595f5a35e0
commit
f8f214ca90
@ -30,6 +30,10 @@ public enum RelativeGoalBlock implements IDatatypePost<GoalBlock, BetterBlockPos
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoalBlock apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
public GoalBlock apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
||||||
|
if (origin == null) {
|
||||||
|
origin = BetterBlockPos.ORIGIN;
|
||||||
|
}
|
||||||
|
|
||||||
final ArgConsumer consumer = ctx.getConsumer();
|
final ArgConsumer consumer = ctx.getConsumer();
|
||||||
return new GoalBlock(
|
return new GoalBlock(
|
||||||
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)),
|
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)),
|
||||||
|
@ -30,6 +30,10 @@ public enum RelativeGoalXZ implements IDatatypePost<GoalXZ, BetterBlockPos> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoalXZ apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
public GoalXZ apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
||||||
|
if (origin == null) {
|
||||||
|
origin = BetterBlockPos.ORIGIN;
|
||||||
|
}
|
||||||
|
|
||||||
final ArgConsumer consumer = ctx.getConsumer();
|
final ArgConsumer consumer = ctx.getConsumer();
|
||||||
return new GoalXZ(
|
return new GoalXZ(
|
||||||
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)),
|
MathHelper.floor(consumer.getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.x)),
|
||||||
|
@ -30,6 +30,10 @@ public enum RelativeGoalYLevel implements IDatatypePost<GoalYLevel, BetterBlockP
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoalYLevel apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
public GoalYLevel apply(IDatatypeContext ctx, BetterBlockPos origin) throws CommandException {
|
||||||
|
if (origin == null) {
|
||||||
|
origin = BetterBlockPos.ORIGIN;
|
||||||
|
}
|
||||||
|
|
||||||
return new GoalYLevel(
|
return new GoalYLevel(
|
||||||
MathHelper.floor(ctx.getConsumer().getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.y))
|
MathHelper.floor(ctx.getConsumer().getDatatypePost(RelativeCoordinate.INSTANCE, (double) origin.y))
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user