Skip to content

Commit 1b0daf5

Browse files
committed
Fix ladders.
1 parent acf321c commit 1b0daf5

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/main/java/baritone/pathing/movement/Clutch.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ protected Clutch(boolean pickupable, ItemStack... stack) {
3030
this.pickupable = pickupable;
3131
this.stack = stack;
3232
}
33-
public ItemStack[] getItemStack() {
34-
return stack;
35-
}
3633
public boolean isPickupable() {
3734
return pickupable;
3835
}

src/main/java/baritone/pathing/movement/clutches/LadderClutch.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import baritone.pathing.movement.Clutch;
2222
import baritone.pathing.movement.MovementHelper;
2323
import baritone.utils.pathing.MutableClutchResult;
24+
import net.minecraft.core.BlockPos;
25+
import net.minecraft.core.Direction;
2426
import net.minecraft.world.item.ItemStack;
2527
import net.minecraft.world.item.Items;
2628
import net.minecraft.world.level.block.Blocks;
@@ -30,18 +32,18 @@ public final class LadderClutch extends Clutch {
3032
public static final Clutch INSTANCE = new LadderClutch();
3133

3234
private LadderClutch() {
33-
super(false, new ItemStack(Items.LADDER), new ItemStack(Items.VINE));
35+
super(false, new ItemStack(Items.LADDER));
3436
}
3537
public boolean compare(BlockState state) {
36-
return state.is(Blocks.LADDER) || state.is(Blocks.VINE);
38+
return state.is(Blocks.LADDER);
3739
}
3840
public boolean clutchable(CalculationContext context, int x, int y, int z, MutableClutchResult result) {
3941
ItemStack item = getClutchingItem(context);
4042
if (MovementHelper.canPlaceAgainst(context.bsi, x, y, z) &&
41-
(MovementHelper.canPlaceAgainst(context.bsi, x - 1, y + 1, z) ||
42-
MovementHelper.canPlaceAgainst(context.bsi, x + 1, y + 1, z) ||
43-
MovementHelper.canPlaceAgainst(context.bsi, x, y + 1, z - 1) ||
44-
MovementHelper.canPlaceAgainst(context.bsi, x, y + 1, z + 1)) &&
43+
(context.get(x - 1, y + 1, z).isFaceSturdy(context.bsi.access, new BlockPos(x - 1, y + 1, z), Direction.EAST) ||
44+
context.get(x + 1, y + 1, z).isFaceSturdy(context.bsi.access, new BlockPos(x + 1, y + 1, z), Direction.WEST) ||
45+
context.get(x, y + 1, z - 1).isFaceSturdy(context.bsi.access, new BlockPos(x, y + 1, z - 1), Direction.SOUTH) ||
46+
context.get(x, y + 1, z + 1).isFaceSturdy(context.bsi.access, new BlockPos(x, y + 1, z + 1), Direction.NORTH)) &&
4547
item != null) {
4648
if (result != null) {
4749
result.clutch = INSTANCE;

src/main/java/baritone/pathing/movement/clutches/VineClutch.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public final class VineClutch extends Clutch {
3535
public static final Clutch INSTANCE = new VineClutch();
3636

3737
private VineClutch() {
38-
super(false, new ItemStack(Items.VINE), new ItemStack(Items.VINE));
38+
super(false, new ItemStack(Items.VINE));
3939
}
4040
public boolean compare(BlockState state) {
4141
return state.is(Blocks.VINE);

0 commit comments

Comments
 (0)