21
21
import baritone .pathing .movement .Clutch ;
22
22
import baritone .pathing .movement .MovementHelper ;
23
23
import baritone .utils .pathing .MutableClutchResult ;
24
+ import net .minecraft .core .BlockPos ;
25
+ import net .minecraft .core .Direction ;
24
26
import net .minecraft .world .item .ItemStack ;
25
27
import net .minecraft .world .item .Items ;
26
28
import net .minecraft .world .level .block .Blocks ;
@@ -30,18 +32,18 @@ public final class LadderClutch extends Clutch {
30
32
public static final Clutch INSTANCE = new LadderClutch ();
31
33
32
34
private LadderClutch () {
33
- super (false , new ItemStack (Items .LADDER ), new ItemStack ( Items . VINE ) );
35
+ super (false , new ItemStack (Items .LADDER ));
34
36
}
35
37
public boolean compare (BlockState state ) {
36
- return state .is (Blocks .LADDER ) || state . is ( Blocks . VINE ) ;
38
+ return state .is (Blocks .LADDER );
37
39
}
38
40
public boolean clutchable (CalculationContext context , int x , int y , int z , MutableClutchResult result ) {
39
41
ItemStack item = getClutchingItem (context );
40
42
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 )) &&
45
47
item != null ) {
46
48
if (result != null ) {
47
49
result .clutch = INSTANCE ;
0 commit comments