fix toxic clouds in legit mine

This commit is contained in:
Leijurv 2018-11-13 12:20:27 -08:00
parent 1ab3e61984
commit 72058c792a
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
3 changed files with 9 additions and 6 deletions

View File

@ -75,7 +75,7 @@ public class GoalRunAway implements Goal {
} }
min = -min; min = -min;
if (maintainY.isPresent()) { if (maintainY.isPresent()) {
min = min * 0.5 + GoalYLevel.calculate(maintainY.get(), y); min = min * 0.6 + GoalYLevel.calculate(maintainY.get(), y) * 1.5;
} }
return min; return min;
} }

View File

@ -64,16 +64,17 @@ public class MovementFall extends Movement {
} }
BlockPos playerFeet = playerFeet(); BlockPos playerFeet = playerFeet();
Rotation toDest = RotationUtils.calcRotationFromVec3d(playerHead(), VecUtils.getBlockPosCenter(dest));
Rotation targetRotation = null; Rotation targetRotation = null;
if (!MovementHelper.isWater(dest) && src.getY() - dest.getY() > Baritone.settings().maxFallHeightNoWater.get() && !playerFeet.equals(dest)) { if (!MovementHelper.isWater(dest) && src.getY() - dest.getY() > Baritone.settings().maxFallHeightNoWater.get() && !playerFeet.equals(dest)) {
if (!InventoryPlayer.isHotbar(player().inventory.getSlotFor(STACK_BUCKET_WATER)) || world().provider.isNether()) { if (!InventoryPlayer.isHotbar(player().inventory.getSlotFor(STACK_BUCKET_WATER)) || world().provider.isNether()) {
return state.setStatus(MovementStatus.UNREACHABLE); return state.setStatus(MovementStatus.UNREACHABLE);
} }
if (player().posY - dest.getY() < playerController().getBlockReachDistance()) { if (player().posY - dest.getY() < playerController().getBlockReachDistance() && !player().onGround) {
player().inventory.currentItem = player().inventory.getSlotFor(STACK_BUCKET_WATER); player().inventory.currentItem = player().inventory.getSlotFor(STACK_BUCKET_WATER);
targetRotation = new Rotation(player().rotationYaw, 90.0F); targetRotation = new Rotation(toDest.getYaw(), 90.0F);
RayTraceResult trace = mc.objectMouseOver; RayTraceResult trace = mc.objectMouseOver;
if (trace != null && trace.typeOfHit == RayTraceResult.Type.BLOCK && player().rotationPitch > 89.0F) { if (trace != null && trace.typeOfHit == RayTraceResult.Type.BLOCK && player().rotationPitch > 89.0F) {
@ -84,7 +85,7 @@ public class MovementFall extends Movement {
if (targetRotation != null) { if (targetRotation != null) {
state.setTarget(new MovementTarget(targetRotation, true)); state.setTarget(new MovementTarget(targetRotation, true));
} else { } else {
state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(playerHead(), VecUtils.getBlockPosCenter(dest)), false)); state.setTarget(new MovementTarget(toDest, false));
} }
if (playerFeet.equals(dest) && (player().posY - playerFeet.getY() < 0.094 || MovementHelper.isWater(dest))) { // 0.094 because lilypads if (playerFeet.equals(dest) && (player().posY - playerFeet.getY() < 0.094 || MovementHelper.isWater(dest))) { // 0.094 because lilypads
if (MovementHelper.isWater(dest)) { if (MovementHelper.isWater(dest)) {

View File

@ -192,8 +192,7 @@ public class MovementPillar extends Movement {
return state.setStatus(MovementStatus.UNREACHABLE); return state.setStatus(MovementStatus.UNREACHABLE);
} }
// If our Y coordinate is above our goal, stop jumping
state.setInput(InputOverrideHandler.Input.JUMP, player().posY < dest.getY());
state.setInput(InputOverrideHandler.Input.SNEAK, player().posY > dest.getY()); // delay placement by 1 tick for ncp compatibility state.setInput(InputOverrideHandler.Input.SNEAK, player().posY > dest.getY()); // delay placement by 1 tick for ncp compatibility
// since (lower down) we only right click once player.isSneaking, and that happens the tick after we request to sneak // since (lower down) we only right click once player.isSneaking, and that happens the tick after we request to sneak
@ -209,6 +208,9 @@ public class MovementPillar extends Movement {
// revise our target to both yaw and pitch if we're going to be moving forward // revise our target to both yaw and pitch if we're going to be moving forward
state.setTarget(new MovementState.MovementTarget(rotation, true)); state.setTarget(new MovementState.MovementTarget(rotation, true));
} else {
// If our Y coordinate is above our goal, stop jumping
state.setInput(InputOverrideHandler.Input.JUMP, player().posY < dest.getY());
} }