Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
75a3acd
Add initial support for overworld/end flight
underscore-zi Mar 15, 2025
dd2240a
update to nether-pathfinder api/concurrency changes
babbaj Mar 16, 2025
9d0a4cb
Make usage of the Baritone cache optional for elytra flight
underscore-zi Mar 16, 2025
984c71e
Set a better default Y for elytra GoalXZ
underscore-zi Mar 16, 2025
319aa58
Make sure player is in bounds before attempting elytra pathfinding
underscore-zi Mar 16, 2025
18a6899
Allow landing on bedrock (necessary for nether roof)
underscore-zi Mar 16, 2025
662ba65
Revert "Set a better default Y for elytra GoalXZ"
underscore-zi Mar 16, 2025
c9aa9f7
GoalXZ y-level will consider if player is above nether roof
underscore-zi Mar 24, 2025
b0ba8d3
Rework landing to be safed when descending from high y-levels, and ut…
underscore-zi Mar 24, 2025
1a6c43e
Check negative y landing spots too
underscore-zi Mar 24, 2025
2004a1d
Merge branch 'cabaletta:1.19.4' into 1.19.4
underscore-zi Mar 26, 2025
cf3260c
dynamically change destination y if the roof gets in the way
babbaj Apr 2, 2025
2290801
1.6
babbaj Apr 4, 2025
3fb41ea
memset if no air also cave air is real
babbaj Apr 4, 2025
c7b76bc
custom allocator by default :^)
babbaj Apr 5, 2025
094b3ef
Respect allowAboveRoof roof setting when looking for safe landing spots
underscore-zi Apr 5, 2025
1ea67c2
Allow landing on cobblestone and obsidian
underscore-zi Apr 5, 2025
7feaa51
elytra fixes
babbaj Apr 10, 2025
f3e6116
hold write lock in queueBlockUpdate
babbaj Apr 11, 2025
d0c3aea
Keep zero-based coordinates to within pathfinder code
underscore-zi Apr 12, 2025
75096e1
fix crashes
babbaj Apr 13, 2025
42e1a7a
Merge remote-tracking branch 'origin/1.19.4' into nether-elytra-update
babbaj Apr 13, 2025
470ef10
final
babbaj Apr 13, 2025
0912069
rename elytraUseBaritoneCache
babbaj Apr 13, 2025
20c1631
oops
babbaj Apr 13, 2025
68dc110
fix #elytra reset bypassing y checks
babbaj Apr 15, 2025
04813a8
i forgor to commit this
babbaj Apr 15, 2025
3d5b744
fixes
babbaj Apr 15, 2025
e545294
fix exception when setting out of bounds goal while elytra flying
babbaj Apr 22, 2025
5624d4a
fix deadlock
babbaj Apr 23, 2025
a2784be
Create an interface for elytra pathfinding
underscore-zi Jul 11, 2025
04c4ba2
Add IElytraContextFactory
underscore-zi Jul 11, 2025
0f28075
Implementation of flight above build limit for long distances
underscore-zi Aug 29, 2025
6b3e5f3
Don't use the Sky pathfinder when in the nether and no roof allowed
underscore-zi Aug 29, 2025
248e644
Prevent races between destruction and creation of ElytraBehavior
underscore-zi Aug 29, 2025
94a466b
Prevent deadlock when rapidly changing goals and the solver never get…
underscore-zi Aug 30, 2025
cf91405
Merge remote-tracking branch 'origin/1.19.4' into nether-elytra-update
babbaj Sep 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ forge_version=45.0.43

fabric_version=0.14.11

nether_pathfinder_version=1.4.1
nether_pathfinder_version=1.6

// These dependencies are used for common and tweaker
// while mod loaders usually ship their own version
Expand Down
30 changes: 30 additions & 0 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -1543,6 +1543,36 @@ public final class Settings {
*/
public final Setting<Boolean> elytraChatSpam = new Setting<>(false);

/**
* May reduce memory usage by using a custom allocator for pathfinding
*/
public final Setting<Boolean> elytraCustomAllocator = new Setting<>(true);

/**
* Allow the pathfinder to attempt flight in tighter spaces, useful in caves but can be dangerous.
*/
public final Setting<Boolean> elytraAllowTightSpaces = new Setting<>(false);

/**
* Allow the pathfinder to fly above y 128 in the nether.
*/
public final Setting<Boolean> elytraAllowAboveRoof = new Setting<>(false);

/**
* Allow the pathfinder to access the baritone cache to improve pathing
*/
public final Setting<Boolean> elytraUseCache = new Setting<>(true);

/**
* Allow the pathfinder to fly above the build limit in the overworld and end.
*/
public final Setting<Boolean> elytraAllowAboveBuildLimit = new Setting<>(true);

/**
* Minimum distance in blocks of an elytra trip before the pathfinder will try to fly above build limit. (Minimum: 32). Requires {@link #elytraAllowAboveBuildLimit} to be enabled.
*/
public final Setting<Integer> elytraLongDistanceThreshold = new Setting<>(500);

/**
* A map of lowercase setting field names to their respective setting
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/

package baritone.api.pathing.elytra;

import baritone.api.utils.IPlayerContext;

import java.nio.file.Path;

public interface IElytraContextFactory {
IElytraPathfinderContext create(IPlayerContext ctx, Path cacheDir);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file is part of Baritone.
*
* Baritone is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Baritone is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/

package baritone.api.pathing.elytra;

import baritone.api.event.events.BlockChangeEvent;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.phys.Vec3;

import java.util.concurrent.CompletableFuture;

public interface IElytraPathfinderContext {
public boolean hasChunk(ChunkPos pos);
public void queueCacheCulling(int chunkX, int chunkZ, int maxDistanceBlocks);
public void queueForPacking(final LevelChunk chunkIn);
public void queueBlockUpdate(BlockChangeEvent event);
public CompletableFuture<UnpackedSegment> pathFindAsync(final BlockPos src, final BlockPos dst);
public boolean raytrace(final double startX, final double startY, final double startZ,
final double endX, final double endY, final double endZ);
public boolean raytrace(final Vec3 start, final Vec3 end);
public boolean raytrace(final int count, final double[] src, final double[] dst, final int visibility);
public void cancel();
public void destroy();
public long getSeed();

public void RLock();
public void RUnlock();

public int getMaxHeight();
public boolean passable(int x, int y, int z);

public static final class Visibility {
public static final int ALL = 0;
public static final int NONE = 1;
public static final int ANY = 2;
private Visibility() {}
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with Baritone. If not, see <https://www.gnu.org/licenses/>.
*/

package baritone.process.elytra;
package baritone.api.pathing.elytra;

import baritone.api.utils.BetterBlockPos;
import dev.babbaj.pathfinder.PathSegment;
Expand Down
6 changes: 6 additions & 0 deletions src/api/java/baritone/api/process/IElytraProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

package baritone.api.process;

import baritone.api.pathing.elytra.IElytraContextFactory;
import baritone.api.pathing.goals.Goal;
import net.minecraft.core.BlockPos;

Expand All @@ -43,6 +44,11 @@ public interface IElytraProcess extends IBaritoneProcess {
*/
boolean isLoaded();


IElytraContextFactory getContextFactory();
void setContextFactory(IElytraContextFactory factory);


/*
* FOR INTERNAL USE ONLY. MAY BE REMOVED AT ANY TIME.
*/
Expand Down
25 changes: 15 additions & 10 deletions src/main/java/baritone/command/defaults/ElytraCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ public void execute(String label, IArgConsumer args) throws CommandException {
if (iGoal == null) {
throw new CommandInvalidStateException("No goal has been set");
}
if (ctx.world().dimension() != Level.NETHER) {
throw new CommandInvalidStateException("Only works in the nether");
}
try {
elytra.pathTo(iGoal);
} catch (IllegalArgumentException ex) {
Expand All @@ -85,7 +82,11 @@ public void execute(String label, IArgConsumer args) throws CommandException {
final String action = args.getString();
switch (action) {
case "reset": {
elytra.resetState();
try {
elytra.resetState();
} catch (IllegalArgumentException ex) {
throw new CommandInvalidStateException(ex.getMessage());
}
logDirect("Reset state but still flying to same goal");
break;
}
Expand Down Expand Up @@ -128,22 +129,26 @@ private Component suggest2b2tSeeds() {
private void gatekeep() {
MutableComponent gatekeep = Component.literal("");
gatekeep.append("To disable this message, enable the setting elytraTermsAccepted\n");
gatekeep.append("Baritone Elytra is an experimental feature. It is only intended for long distance travel in the Nether using fireworks for vanilla boost. It will not work with any other mods (\"hacks\") for non-vanilla boost. ");
gatekeep.append("Baritone Elytra is an experimental feature. It is intended for long distance travel in the Nether but will also work in the Overworld, using fireworks for vanilla boost. It will not work with any other mods (\"hacks\") for non-vanilla boost. ");
MutableComponent gatekeep2 = Component.literal("If you want Baritone to attempt to take off from the ground for you, you can enable the elytraAutoJump setting (not advisable on laggy servers!). ");
gatekeep2.setStyle(gatekeep2.getStyle().withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.literal(Baritone.settings().prefix.value + "set elytraAutoJump true"))));
gatekeep.append(gatekeep2);
MutableComponent gatekeep3 = Component.literal("If you want Baritone to go slower, enable the elytraConserveFireworks setting and/or decrease the elytraFireworkSpeed setting. ");
gatekeep3.setStyle(gatekeep3.getStyle().withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.literal(Baritone.settings().prefix.value + "set elytraConserveFireworks true\n" + Baritone.settings().prefix.value + "set elytraFireworkSpeed 0.6\n(the 0.6 number is just an example, tweak to your liking)"))));
gatekeep.append(gatekeep3);
MutableComponent gatekeep4 = Component.literal("Baritone Elytra ");
MutableComponent red = Component.literal("wants to know the seed");
red.setStyle(red.getStyle().withColor(ChatFormatting.RED).withUnderlined(true).withBold(true));
gatekeep4.append(red);
MutableComponent gatekeep4 = Component.literal("Baritone Elytra for use in the ");
MutableComponent red1 = Component.literal("Nether");
red1.setStyle(red1.getStyle().withColor(ChatFormatting.RED).withUnderlined(true).withBold(true));
gatekeep4.append(red1);
gatekeep4.append(", ");
MutableComponent red2 = Component.literal("wants to know the seed");
red2.setStyle(red2.getStyle().withColor(ChatFormatting.RED).withUnderlined(true).withBold(true));
gatekeep4.append(red2);
gatekeep4.append(" of the world you are in. If it doesn't have the correct seed, it will frequently backtrack. It uses the seed to generate terrain far beyond what you can see, since terrain obstacles in the Nether can be much larger than your render distance. ");
gatekeep.append(gatekeep4);
gatekeep.append("\n");
if (detectOn2b2t()) {
MutableComponent gatekeep5 = Component.literal("It looks like you're on 2b2t. ");
MutableComponent gatekeep5 = Component.literal("It looks like you're on 2b2t. Terrain prediction can be used but new nether terrain can not be predicted on 2b2t. ");
gatekeep5.append(suggest2b2tSeeds());
if (!Baritone.settings().elytraPredictTerrain.value) {
gatekeep5.append(Baritone.settings().prefix.value + "elytraPredictTerrain is currently disabled. ");
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/baritone/process/CustomGoalProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import baritone.api.process.PathingCommand;
import baritone.api.process.PathingCommandType;
import baritone.utils.BaritoneProcessHelper;
import net.minecraft.ChatFormatting;

/**
* As set by ExampleBaritoneControl or something idk
Expand Down Expand Up @@ -57,7 +58,11 @@ public void setGoal(Goal goal) {
this.goal = goal;
this.mostRecentGoal = goal;
if (baritone.getElytraProcess().isActive()) {
baritone.getElytraProcess().pathTo(goal);
try {
baritone.getElytraProcess().pathTo(goal);
} catch (IllegalArgumentException e) {
logDirect("Failed to update elytra goal because: " + e.getMessage(), ChatFormatting.RED);
}
}
if (this.state == State.NONE) {
this.state = State.GOAL_SET;
Expand Down
Loading