fix a bunch of scuff
This commit is contained in:
@@ -24,7 +24,10 @@ import net.minecraft.block.state.IBlockState;
|
|||||||
import net.minecraft.client.entity.EntityPlayerSP;
|
import net.minecraft.client.entity.EntityPlayerSP;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.math.*;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.util.math.shapes.VoxelShape;
|
import net.minecraft.util.math.shapes.VoxelShape;
|
||||||
|
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -176,7 +179,7 @@ public final class RotationUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IBlockState state = entity.world.getBlockState(pos);
|
IBlockState state = entity.world.getBlockState(pos);
|
||||||
VoxelShape shape = state.getCollisionShape(entity.world, pos);
|
VoxelShape shape = state.getRaytraceShape(entity.world, pos);
|
||||||
for (Vec3d sideOffset : BLOCK_SIDE_MULTIPLIERS) {
|
for (Vec3d sideOffset : BLOCK_SIDE_MULTIPLIERS) {
|
||||||
double xDiff = shape.getStart(EnumFacing.Axis.X) * sideOffset.x + shape.getEnd(EnumFacing.Axis.X) * (1 - sideOffset.x);
|
double xDiff = shape.getStart(EnumFacing.Axis.X) * sideOffset.x + shape.getEnd(EnumFacing.Axis.X) * (1 - sideOffset.x);
|
||||||
double yDiff = shape.getStart(EnumFacing.Axis.Y) * sideOffset.y + shape.getEnd(EnumFacing.Axis.Y) * (1 - sideOffset.y);
|
double yDiff = shape.getStart(EnumFacing.Axis.Y) * sideOffset.y + shape.getEnd(EnumFacing.Axis.Y) * (1 - sideOffset.y);
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
Block block = state.getBlock();
|
Block block = state.getBlock();
|
||||||
if (block == Blocks.AIR || isWater(state)) {
|
if (block == Blocks.AIR) {
|
||||||
// early return for common cases hehe
|
// early return for common cases hehe
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -500,7 +500,7 @@ public interface MovementHelper extends ActionCosts, Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static boolean possiblyFlowing(IBlockState state) {
|
static boolean possiblyFlowing(IBlockState state) {
|
||||||
IFluidState fluidState = state.getFluidState();
|
IFluidState fluidState = state.getFluidState();
|
||||||
return fluidState.getFluid() instanceof FlowingFluid
|
return fluidState.getFluid() instanceof FlowingFluid
|
||||||
&& fluidState.getFluid().getLevel(fluidState) != 8;
|
&& fluidState.getFluid().getLevel(fluidState) != 8;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import net.minecraft.util.math.BlockPos;
|
|||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
public class MovementPillar extends Movement {
|
public class MovementPillar extends Movement {
|
||||||
|
|
||||||
@@ -79,7 +80,7 @@ public class MovementPillar extends Movement {
|
|||||||
if (!ladder && !context.canPlaceThrowawayAt(x, y, z)) { // we need to place a block where we started to jump on it
|
if (!ladder && !context.canPlaceThrowawayAt(x, y, z)) { // we need to place a block where we started to jump on it
|
||||||
return COST_INF;
|
return COST_INF;
|
||||||
}
|
}
|
||||||
if (MovementHelper.isLiquid(fromState) || (MovementHelper.isLiquid(fromDown) && context.assumeWalkOnWater)) {
|
if ((MovementHelper.isLiquid(fromState) && !MovementHelper.canPlaceAgainst(fromDown)) || (MovementHelper.isLiquid(fromDown) && context.assumeWalkOnWater)) {
|
||||||
// otherwise, if we're standing in water, we cannot pillar
|
// otherwise, if we're standing in water, we cannot pillar
|
||||||
// if we're standing on water and assumeWalkOnWater is true, we cannot pillar
|
// if we're standing on water and assumeWalkOnWater is true, we cannot pillar
|
||||||
// if we're standing on water and assumeWalkOnWater is false, we must have ascended to here, or sneak backplaced, so it is possible to pillar again
|
// if we're standing on water and assumeWalkOnWater is false, we must have ascended to here, or sneak backplaced, so it is possible to pillar again
|
||||||
@@ -162,6 +163,7 @@ public class MovementPillar extends Movement {
|
|||||||
state.setInput(Input.MOVE_FORWARD, true);
|
state.setInput(Input.MOVE_FORWARD, true);
|
||||||
}
|
}
|
||||||
if (ctx.playerFeet().equals(dest)) {
|
if (ctx.playerFeet().equals(dest)) {
|
||||||
|
logDebug("wtf2");
|
||||||
return state.setStatus(MovementStatus.SUCCESS);
|
return state.setStatus(MovementStatus.SUCCESS);
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
@@ -184,6 +186,7 @@ public class MovementPillar extends Movement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.playerFeet().equals(against.up()) || ctx.playerFeet().equals(dest)) {
|
if (ctx.playerFeet().equals(against.up()) || ctx.playerFeet().equals(dest)) {
|
||||||
|
logDebug("wtf3");
|
||||||
return state.setStatus(MovementStatus.SUCCESS);
|
return state.setStatus(MovementStatus.SUCCESS);
|
||||||
}
|
}
|
||||||
if (MovementHelper.isBottomSlab(BlockStateInterface.get(ctx, src.down()))) {
|
if (MovementHelper.isBottomSlab(BlockStateInterface.get(ctx, src.down()))) {
|
||||||
@@ -231,6 +234,10 @@ public class MovementPillar extends Movement {
|
|||||||
Block fr = frState.getBlock();
|
Block fr = frState.getBlock();
|
||||||
// TODO: Evaluate usage of getMaterial().isReplaceable()
|
// TODO: Evaluate usage of getMaterial().isReplaceable()
|
||||||
if (!(fr instanceof BlockAir || frState.getMaterial().isReplaceable())) {
|
if (!(fr instanceof BlockAir || frState.getMaterial().isReplaceable())) {
|
||||||
|
Optional<Rotation> reachable = RotationUtils.reachable(ctx.player(), src, ctx.playerController().getBlockReachDistance());
|
||||||
|
if (reachable.isPresent()) {
|
||||||
|
state.setTarget(new MovementState.MovementTarget(reachable.get(), true));
|
||||||
|
}
|
||||||
state.setInput(Input.CLICK_LEFT, true);
|
state.setInput(Input.CLICK_LEFT, true);
|
||||||
blockIsThere = false;
|
blockIsThere = false;
|
||||||
} else if (ctx.player().isSneaking() && (Objects.equals(src.down(), ctx.objectMouseOver().getBlockPos()) || Objects.equals(src, ctx.objectMouseOver().getBlockPos())) && ctx.player().posY > dest.getY() + 0.1) {
|
} else if (ctx.player().isSneaking() && (Objects.equals(src.down(), ctx.objectMouseOver().getBlockPos()) || Objects.equals(src, ctx.objectMouseOver().getBlockPos())) && ctx.player().posY > dest.getY() + 0.1) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class CustomGoalProcess extends BaritoneProcessHelper implements ICustomG
|
|||||||
onLostControl();
|
onLostControl();
|
||||||
return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
if (this.goal == null || this.goal.isInGoal(ctx.playerFeet())) {
|
if (this.goal == null || (this.goal.isInGoal(ctx.playerFeet()) && ctx.player().onGround)) {
|
||||||
onLostControl(); // we're there xd
|
onLostControl(); // we're there xd
|
||||||
return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
return new PathingCommand(this.goal, PathingCommandType.CANCEL_AND_SET_GOAL);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class GetToBlockProcess extends BaritoneProcessHelper implements IGetToBl
|
|||||||
CalculationContext context = new CalculationContext(baritone, true);
|
CalculationContext context = new CalculationContext(baritone, true);
|
||||||
Baritone.getExecutor().execute(() -> rescan(current, context));
|
Baritone.getExecutor().execute(() -> rescan(current, context));
|
||||||
}
|
}
|
||||||
if (goal.isInGoal(ctx.playerFeet()) && isSafeToCancel) {
|
if (goal.isInGoal(ctx.playerFeet()) && ctx.player().onGround && isSafeToCancel) {
|
||||||
// we're there
|
// we're there
|
||||||
if (rightClickOnArrival(gettingTo)) {
|
if (rightClickOnArrival(gettingTo)) {
|
||||||
if (rightClick()) {
|
if (rightClick()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user