Skip to content

Commit

Permalink
Merge pull request #4636 from Lyzev/1.19.4
Browse files Browse the repository at this point in the history
add(Settings): added settings to control block placement in fluid sources and flowing fluids
  • Loading branch information
leijurv authored Feb 8, 2025
2 parents 3c9f5b2 + 59157c1 commit 849072f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/api/java/baritone/api/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ public final class Settings {
*/
public final Setting<Boolean> allowPlace = new Setting<>(true);

/**
* Allow Baritone to place blocks in fluid source blocks
*/
public final Setting<Boolean> allowPlaceInFluidsSource = new Setting<>(true);

/**
* Allow Baritone to place blocks in flowing fluid
*/
public final Setting<Boolean> allowPlaceInFluidsFlow = new Setting<>(true);

/**
* Allow Baritone to move items in your inventory to your hotbar
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ public double costOfPlacingAt(int x, int y, int z, BlockState current) {
if (!worldBorder.canPlaceAt(x, z)) {
return COST_INF;
}
if (!Baritone.settings().allowPlaceInFluidsSource.value && current.getFluidState().isSource()) {
return COST_INF;
}
if (!Baritone.settings().allowPlaceInFluidsFlow.value && !current.getFluidState().isEmpty() && !current.getFluidState().isSource()) {
return COST_INF;
}
return placeBlockCost;
}

Expand Down

0 comments on commit 849072f

Please sign in to comment.