@@ -118,6 +118,7 @@ public static enum StopOnType
118118 MOBS ("Mobs" ),
119119 BLOCKS ("Blocks" ),
120120 ITEMS ("Items" ),
121+ ROOF_ESP ("RoofESP" ),
121122 OLD_CHUNKS ("Old chunk" ),
122123 NEW_CHUNKS ("New chunk" ),
123124 END_PORTAL ("End portal" ),
@@ -268,6 +269,14 @@ public String toString()
268269 "Stop keyword 2" ,
269270 "Keyword to match against the second Stop on type (ignored for portals)." ,
270271 "" );
272+ private final EnumSetting <StopOnType > stopOn3 = new EnumSetting <>(
273+ "Stop on 3" ,
274+ "Optional third stop reason. AutoFly stops if any Stop on setting matches." ,
275+ StopOnType .values (), StopOnType .OFF );
276+ private final TextFieldSetting stopKeyword3 = new TextFieldSetting (
277+ "Stop keyword 3" ,
278+ "Keyword to match against the third Stop on type (ignored for portals)." ,
279+ "" );
271280 private final SliderSetting stopChunkThickness = new SliderSetting (
272281 "Chunk stop thickness" ,
273282 "For Old/New chunk stop modes, require this many contiguous matching"
@@ -373,6 +382,8 @@ public String toString()
373382 private boolean enabledAntisocialForAutoFly ;
374383 private boolean enabledAutoEatForAutoFly ;
375384 private boolean enabledAutoLeaveForAutoFly ;
385+ private boolean enabledNewerNewChunksForStopOn ;
386+ private boolean enabledRoofEspForStopOn ;
376387
377388 private boolean closeHorizLatched ;
378389 private int stopScanCooldown ;
@@ -423,6 +434,8 @@ public AutoFlyHack()
423434 addSetting (stopKeyword );
424435 addSetting (stopOn2 );
425436 addSetting (stopKeyword2 );
437+ addSetting (stopOn3 );
438+ addSetting (stopKeyword3 );
426439 addSetting (stopChunkThickness );
427440 addSetting (disableAutoFlyOnStop );
428441 addSetting (disableOnPlayers );
@@ -538,6 +551,8 @@ else if(routeType.getSelected() == RouteType.CHUNKS)
538551 enabledAntisocialForAutoFly = false ;
539552 enabledAutoEatForAutoFly = false ;
540553 enabledAutoLeaveForAutoFly = false ;
554+ enabledNewerNewChunksForStopOn = false ;
555+ enabledRoofEspForStopOn = false ;
541556
542557 var hax = WURST .getHax ();
543558 if (useAntisocial .isChecked () && !hax .antisocialHack .isEnabled ())
@@ -576,9 +591,15 @@ protected void onDisable()
576591 hax .autoEatHack .setEnabled (false );
577592 if (enabledAutoLeaveForAutoFly && hax .autoLeaveHack .isEnabled ())
578593 hax .autoLeaveHack .setEnabled (false );
594+ if (enabledNewerNewChunksForStopOn && hax .newerNewChunksHack .isEnabled ())
595+ hax .newerNewChunksHack .setEnabled (false );
596+ if (enabledRoofEspForStopOn && hax .roofEspHack .isEnabled ())
597+ hax .roofEspHack .setEnabled (false );
579598 enabledAntisocialForAutoFly = false ;
580599 enabledAutoEatForAutoFly = false ;
581600 enabledAutoLeaveForAutoFly = false ;
601+ enabledNewerNewChunksForStopOn = false ;
602+ enabledRoofEspForStopOn = false ;
582603 pausedNoY = false ;
583604 arrivalPause = false ;
584605 arrivalPauseUntilMs = 0L ;
@@ -688,6 +709,9 @@ public void onUpdate()
688709 if (checkStopOn (stopOn2 , stopKeyword2 , true ))
689710 return ;
690711
712+ if (checkStopOn (stopOn3 , stopKeyword3 , false ))
713+ return ;
714+
691715 if (checkStopOnPlayers ())
692716 return ;
693717
@@ -1031,6 +1055,18 @@ private boolean checkStopOn(EnumSetting<StopOnType> stopSetting,
10311055 return false ;
10321056 }
10331057
1058+ case ROOF_ESP ->
1059+ {
1060+ ensureRoofEspForStopOn ();
1061+ if (WURST .getHax ().roofEspHack .isEnabled ()
1062+ && WURST .getHax ().roofEspHack .getDetectionCount () > 0 )
1063+ {
1064+ stopAutoFly ("Stopped: Found RoofESP" );
1065+ return true ;
1066+ }
1067+ return false ;
1068+ }
1069+
10341070 case BLOCKS ->
10351071 {
10361072 String kw = getStopKeyword (keywordSetting );
@@ -1192,6 +1228,8 @@ private boolean checkStopOnChunkType(boolean oldChunks, String stopName)
11921228 if (MC .player == null || MC .level == null )
11931229 return false ;
11941230
1231+ ensureNewerNewChunksForStopOn ();
1232+
11951233 ChunkPos playerChunk = ChunkPos .containing (MC .player .blockPosition ());
11961234 boolean containsChunk = isMatchingChunkType (playerChunk , oldChunks );
11971235 if (!containsChunk )
@@ -1320,6 +1358,30 @@ private void stopAutoFly(String message)
13201358 stopIgnoreTicks = 0 ;
13211359 }
13221360
1361+ private void ensureNewerNewChunksForStopOn ()
1362+ {
1363+ var newerNewChunks = WURST .getHax ().newerNewChunksHack ;
1364+ if (newerNewChunks .isEnabled ())
1365+ return ;
1366+
1367+ newerNewChunks .setEnabled (true );
1368+ enabledNewerNewChunksForStopOn = true ;
1369+ ChatUtils .message (
1370+ "NewerNewChunks was enabled due to stop condition in AutoFly." );
1371+ }
1372+
1373+ private void ensureRoofEspForStopOn ()
1374+ {
1375+ var roofEsp = WURST .getHax ().roofEspHack ;
1376+ if (roofEsp .isEnabled ())
1377+ return ;
1378+
1379+ roofEsp .setEnabled (true );
1380+ enabledRoofEspForStopOn = true ;
1381+ ChatUtils
1382+ .message ("RoofESP was enabled due to stop condition in AutoFly." );
1383+ }
1384+
13231385 private String getStopKeyword (TextFieldSetting setting )
13241386 {
13251387 if (setting == null )
0 commit comments