@@ -331,6 +331,17 @@ public BlockPos currentDestination() {
331
331
332
332
@ Override
333
333
public void pathTo (BlockPos destination ) {
334
+ int minY = ctx .world ().dimensionType ().minY ();
335
+ int maxY = (ctx .world ().dimension () == Level .NETHER && !Baritone .settings ().elytraAllowAboveRoof .value ) ? 127 : Math .min (minY + 384 , ctx .world ().dimensionType ().height () + minY );
336
+ if (destination .getY () < minY || destination .getY () >= maxY ) {
337
+ throw new IllegalArgumentException ("The goal must have a y value between " + minY + " and " + maxY );
338
+ }
339
+
340
+ int playerY = (int )ctx .player ().getY ();
341
+ if (playerY < minY || playerY >= maxY ) {
342
+ throw new IllegalArgumentException ("The player must have a y value between " + minY + " and " + maxY );
343
+ }
344
+
334
345
this .pathTo0 (destination , false );
335
346
}
336
347
@@ -368,17 +379,6 @@ public void pathTo(Goal iGoal) {
368
379
throw new IllegalArgumentException ("The goal must be a GoalXZ or GoalBlock" );
369
380
}
370
381
371
- int minY = ctx .world ().dimensionType ().minY ();
372
- int maxY = (ctx .world ().dimension () == Level .NETHER && !Baritone .settings ().elytraAllowAboveRoof .value ) ? 127 : Math .min (minY + 384 , ctx .world ().dimensionType ().height () + minY );
373
- if (y < minY || y >= maxY ) {
374
- throw new IllegalArgumentException ("The goal must have a y value between " + minY + " and " + maxY );
375
- }
376
-
377
- int playerY = (int )ctx .player ().getY ();
378
- if (playerY < minY || playerY >= maxY ) {
379
- throw new IllegalArgumentException ("The player must have a y value between " + minY + " and " + maxY );
380
- }
381
-
382
382
this .pathTo (new BlockPos (x , y , z ));
383
383
}
384
384
0 commit comments