Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e7320b954 | ||
|
|
fbb2d37634 | ||
|
|
7afe16fc10 | ||
|
|
b19f241d81 | ||
|
|
583ce80003 | ||
|
|
195c33407e |
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
group 'baritone'
|
||||
version '1.2.0'
|
||||
version '1.2.1'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
|
||||
@@ -40,6 +40,8 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static baritone.pathing.movement.Movement.HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP;
|
||||
|
||||
/**
|
||||
@@ -74,7 +76,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
if (block == Blocks.AIR) { // early return for most common case
|
||||
return true;
|
||||
}
|
||||
if (block == Blocks.FIRE || block == Blocks.TRIPWIRE || block == Blocks.WEB || block == Blocks.END_PORTAL || block == Blocks.COCOA) {
|
||||
if (block == Blocks.FIRE || block == Blocks.TRIPWIRE || block == Blocks.WEB || block == Blocks.END_PORTAL || block == Blocks.COCOA || block instanceof BlockSkull) {
|
||||
return false;
|
||||
}
|
||||
if (block instanceof BlockDoor || block instanceof BlockFenceGate) {
|
||||
@@ -157,7 +159,8 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
|| block instanceof BlockSnow
|
||||
|| block instanceof BlockLiquid
|
||||
|| block instanceof BlockTrapDoor
|
||||
|| block instanceof BlockEndPortal) {
|
||||
|| block instanceof BlockEndPortal
|
||||
|| block instanceof BlockSkull) {
|
||||
return false;
|
||||
}
|
||||
// door, fence gate, liquid, trapdoor have been accounted for, nothing else uses the world or pos parameters
|
||||
@@ -493,7 +496,12 @@ public interface MovementHelper extends ActionCosts, Helper {
|
||||
|
||||
static PlaceResult attemptToPlaceABlock(MovementState state, IBaritone baritone, BlockPos placeAt, boolean preferDown) {
|
||||
IPlayerContext ctx = baritone.getPlayerContext();
|
||||
Optional<Rotation> direct = RotationUtils.reachable(ctx, placeAt); // we assume that if there is a block there, it must be replacable
|
||||
boolean found = false;
|
||||
if (direct.isPresent()) {
|
||||
state.setTarget(new MovementState.MovementTarget(direct.get(), true));
|
||||
found = true;
|
||||
}
|
||||
for (int i = 0; i < 5; i++) {
|
||||
BlockPos against1 = placeAt.offset(HORIZONTALS_BUT_ALSO_DOWN____SO_EVERY_DIRECTION_EXCEPT_UP[i]);
|
||||
if (MovementHelper.canPlaceAgainst(ctx, against1)) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import baritone.pathing.movement.MovementState;
|
||||
import baritone.utils.BlockStateInterface;
|
||||
import baritone.utils.pathing.MutableMoveResult;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockLiquid;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -85,7 +86,7 @@ public class MovementParkour extends Movement {
|
||||
return;
|
||||
}
|
||||
IBlockState standingOn = context.get(x, y - 1, z);
|
||||
if (standingOn.getBlock() == Blocks.VINE || standingOn.getBlock() == Blocks.LADDER || standingOn.getBlock() instanceof BlockStairs || MovementHelper.isBottomSlab(standingOn)) {
|
||||
if (standingOn.getBlock() == Blocks.VINE || standingOn.getBlock() == Blocks.LADDER || standingOn.getBlock() instanceof BlockStairs || MovementHelper.isBottomSlab(standingOn) || standingOn.getBlock() instanceof BlockLiquid) {
|
||||
return;
|
||||
}
|
||||
int maxJump;
|
||||
|
||||
@@ -81,7 +81,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG
|
||||
}
|
||||
return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||
case PATH_REQUESTED:
|
||||
PathingCommand ret = new PathingCommand(this.goal, PathingCommandType.SET_GOAL_AND_PATH);
|
||||
PathingCommand ret = new PathingCommand(this.goal, PathingCommandType.FORCE_REVALIDATE_GOAL_AND_PATH);
|
||||
this.state = State.EXECUTING;
|
||||
return ret;
|
||||
case EXECUTING:
|
||||
|
||||
@@ -115,7 +115,9 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper {
|
||||
}
|
||||
|
||||
// Setup Baritone's pathing goal and (if needed) begin pathing
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(GOAL);
|
||||
if (!BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().isActive()) {
|
||||
BaritoneAPI.getProvider().getPrimaryBaritone().getCustomGoalProcess().setGoalAndPath(GOAL);
|
||||
}
|
||||
|
||||
// If we have reached our goal, print a message and safely close the game
|
||||
if (GOAL.isInGoal(ctx.playerFeet())) {
|
||||
|
||||
Reference in New Issue
Block a user