Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7a9380b9d | |||
| 5617c595b2 | |||
| 8770524679 | |||
| a8ddb2fcf1 | |||
| 76c4ca9ba6 | |||
| ed2b0f0bb9 | |||
| 6702b44b3e | |||
| c486d8241e | |||
| d2bb8c374e | |||
| 530cecea5b | |||
| 266e2dada9 |
+1
-1
@@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
group 'baritone'
|
group 'baritone'
|
||||||
version '1.1.5'
|
version '1.1.6'
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -76,4 +76,11 @@ public interface IBaritone {
|
|||||||
IPlayerContext getPlayerContext();
|
IPlayerContext getPlayerContext();
|
||||||
|
|
||||||
IEventBus getGameEventHandler();
|
IEventBus getGameEventHandler();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call as soon as Minecraft is ready.
|
||||||
|
* <p>
|
||||||
|
* Or whenever your overeager utility client wants.
|
||||||
|
*/
|
||||||
|
void init();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ public class Baritone implements IBaritone {
|
|||||||
this.gameEventHandler = new GameEventHandler(this);
|
this.gameEventHandler = new GameEventHandler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void init() {
|
public synchronized void init() {
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public final class LookBehavior extends Behavior implements ILookBehavior {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerRotationMove(RotationMoveEvent event) {
|
public void onPlayerRotationMove(RotationMoveEvent event) {
|
||||||
if (this.target != null && !this.force) {
|
if (this.target != null) {
|
||||||
|
|
||||||
event.setYaw(this.target.getYaw());
|
event.setYaw(this.target.getYaw());
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ public final class CachedWorld implements ICachedWorld, Helper {
|
|||||||
/**
|
/**
|
||||||
* The maximum number of regions in any direction from (0,0)
|
* The maximum number of regions in any direction from (0,0)
|
||||||
*/
|
*/
|
||||||
private static final int REGION_MAX = 58594;
|
private static final int REGION_MAX = 30_000_000 / 512 + 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map of all of the cached regions.
|
* A map of all of the cached regions.
|
||||||
|
|||||||
@@ -181,14 +181,21 @@ public class MovementAscend extends Movement {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (headBonkClear()) {
|
|
||||||
return state.setInput(Input.JUMP, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
int xAxis = Math.abs(src.getX() - dest.getX()); // either 0 or 1
|
int xAxis = Math.abs(src.getX() - dest.getX()); // either 0 or 1
|
||||||
int zAxis = Math.abs(src.getZ() - dest.getZ()); // either 0 or 1
|
int zAxis = Math.abs(src.getZ() - dest.getZ()); // either 0 or 1
|
||||||
double flatDistToNext = xAxis * Math.abs((dest.getX() + 0.5D) - ctx.player().posX) + zAxis * Math.abs((dest.getZ() + 0.5D) - ctx.player().posZ);
|
double flatDistToNext = xAxis * Math.abs((dest.getX() + 0.5D) - ctx.player().posX) + zAxis * Math.abs((dest.getZ() + 0.5D) - ctx.player().posZ);
|
||||||
double sideDist = zAxis * Math.abs((dest.getX() + 0.5D) - ctx.player().posX) + xAxis * Math.abs((dest.getZ() + 0.5D) - ctx.player().posZ);
|
double sideDist = zAxis * Math.abs((dest.getX() + 0.5D) - ctx.player().posX) + xAxis * Math.abs((dest.getZ() + 0.5D) - ctx.player().posZ);
|
||||||
|
|
||||||
|
double lateralMotion = xAxis * ctx.player().motionZ + zAxis * ctx.player().motionX;
|
||||||
|
if (Math.abs(lateralMotion) > 0.1) {
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (headBonkClear()) {
|
||||||
|
return state.setInput(Input.JUMP, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// System.out.println(flatDistToNext + " " + sideDist);
|
// System.out.println(flatDistToNext + " " + sideDist);
|
||||||
if (flatDistToNext > 1.2 || sideDist > 0.2) {
|
if (flatDistToNext > 1.2 || sideDist > 0.2) {
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class MovementFall extends Movement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
BlockPos playerFeet = ctx.playerFeet();
|
BlockPos playerFeet = ctx.playerFeet();
|
||||||
Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations());
|
Rotation toDest = RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest), ctx.playerRotations());
|
||||||
Rotation targetRotation = null;
|
Rotation targetRotation = null;
|
||||||
Block destBlock = ctx.world().getBlockState(dest).getBlock();
|
Block destBlock = ctx.world().getBlockState(dest).getBlock();
|
||||||
boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER;
|
boolean isWater = destBlock == Blocks.WATER || destBlock == Blocks.FLOWING_WATER;
|
||||||
@@ -141,7 +141,7 @@ public class MovementFall extends Movement {
|
|||||||
}
|
}
|
||||||
if (targetRotation == null) {
|
if (targetRotation == null) {
|
||||||
Vec3d destCenterOffset = new Vec3d(destCenter.x + 0.125 * avoid.getX(), destCenter.y, destCenter.z + 0.125 * avoid.getZ());
|
Vec3d destCenterOffset = new Vec3d(destCenter.x + 0.125 * avoid.getX(), destCenter.y, destCenter.z + 0.125 * avoid.getZ());
|
||||||
state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset,ctx.playerRotations()), false));
|
state.setTarget(new MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), destCenterOffset, ctx.playerRotations()), false));
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class MovementPillar extends Movement {
|
|||||||
IBlockState fromDown = BlockStateInterface.get(ctx, src);
|
IBlockState fromDown = BlockStateInterface.get(ctx, src);
|
||||||
if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) {
|
if (MovementHelper.isWater(fromDown.getBlock()) && MovementHelper.isWater(ctx, dest)) {
|
||||||
// stay centered while swimming up a water column
|
// stay centered while swimming up a water column
|
||||||
state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest),ctx.playerRotations()), false));
|
state.setTarget(new MovementState.MovementTarget(RotationUtils.calcRotationFromVec3d(ctx.playerHead(), VecUtils.getBlockPosCenter(dest), ctx.playerRotations()), false));
|
||||||
Vec3d destCenter = VecUtils.getBlockPosCenter(dest);
|
Vec3d destCenter = VecUtils.getBlockPosCenter(dest);
|
||||||
if (Math.abs(ctx.player().posX - destCenter.x) > 0.2 || Math.abs(ctx.player().posZ - destCenter.z) > 0.2) {
|
if (Math.abs(ctx.player().posX - destCenter.x) > 0.2 || Math.abs(ctx.player().posZ - destCenter.z) > 0.2) {
|
||||||
state.setInput(Input.MOVE_FORWARD, true);
|
state.setInput(Input.MOVE_FORWARD, true);
|
||||||
|
|||||||
@@ -479,6 +479,9 @@ public class PathExecutor implements IPathExecutor, Helper {
|
|||||||
if (dir.getY() < -3) {
|
if (dir.getY() < -3) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if (!movement.toBreakCached.isEmpty()) {
|
||||||
|
return null; // it's breaking
|
||||||
|
}
|
||||||
Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ());
|
Vec3i flatDir = new Vec3i(dir.getX(), 0, dir.getZ());
|
||||||
int i;
|
int i;
|
||||||
outer:
|
outer:
|
||||||
@@ -538,6 +541,12 @@ public class PathExecutor implements IPathExecutor, Helper {
|
|||||||
if (!MovementHelper.canWalkOn(ctx, current.getDest().down())) {
|
if (!MovementHelper.canWalkOn(ctx, current.getDest().down())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!MovementHelper.canWalkOn(ctx, next.getDest().down())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!next.toBreakCached.isEmpty()) {
|
||||||
|
return false; // it's breaking
|
||||||
|
}
|
||||||
for (int x = 0; x < 2; x++) {
|
for (int x = 0; x < 2; x++) {
|
||||||
for (int y = 0; y < 3; y++) {
|
for (int y = 0; y < 3; y++) {
|
||||||
BlockPos chk = current.getSrc().up(y);
|
BlockPos chk = current.getSrc().up(y);
|
||||||
|
|||||||
@@ -57,8 +57,6 @@ public final class PathRenderer implements Helper {
|
|||||||
private PathRenderer() {}
|
private PathRenderer() {}
|
||||||
|
|
||||||
public static void render(RenderEvent event, PathingBehavior behavior) {
|
public static void render(RenderEvent event, PathingBehavior behavior) {
|
||||||
// System.out.println("Render passing");
|
|
||||||
// System.out.println(event.getPartialTicks());
|
|
||||||
float partialTicks = event.getPartialTicks();
|
float partialTicks = event.getPartialTicks();
|
||||||
Goal goal = behavior.getGoal();
|
Goal goal = behavior.getGoal();
|
||||||
|
|
||||||
@@ -80,7 +78,7 @@ public final class PathRenderer implements Helper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (goal != null && Baritone.settings().renderGoal.value) {
|
if (goal != null && Baritone.settings().renderGoal.value) {
|
||||||
drawLitDankGoalBox(renderView, goal, partialTicks, Baritone.settings().colorGoalBox.get());
|
drawDankLitGoalBox(renderView, goal, partialTicks, Baritone.settings().colorGoalBox.get());
|
||||||
}
|
}
|
||||||
if (!Baritone.settings().renderPath.get()) {
|
if (!Baritone.settings().renderPath.get()) {
|
||||||
return;
|
return;
|
||||||
@@ -261,7 +259,7 @@ public final class PathRenderer implements Helper {
|
|||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void drawLitDankGoalBox(Entity player, Goal goal, float partialTicks, Color color) {
|
public static void drawDankLitGoalBox(Entity player, Goal goal, float partialTicks, Color color) {
|
||||||
double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks;
|
double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks;
|
||||||
double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks;
|
double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks;
|
||||||
double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks;
|
double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks;
|
||||||
@@ -332,7 +330,7 @@ public final class PathRenderer implements Helper {
|
|||||||
maxY = 256 - renderPosY;
|
maxY = 256 - renderPosY;
|
||||||
} else if (goal instanceof GoalComposite) {
|
} else if (goal instanceof GoalComposite) {
|
||||||
for (Goal g : ((GoalComposite) goal).goals()) {
|
for (Goal g : ((GoalComposite) goal).goals()) {
|
||||||
drawLitDankGoalBox(player, g, partialTicks, color);
|
drawDankLitGoalBox(player, g, partialTicks, color);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class PlayerMovementInput extends MovementInput {
|
|||||||
this.moveStrafe = 0.0F;
|
this.moveStrafe = 0.0F;
|
||||||
this.moveForward = 0.0F;
|
this.moveForward = 0.0F;
|
||||||
|
|
||||||
jump = handler.isInputForcedDown(Input.JUMP); // oppa
|
jump = handler.isInputForcedDown(Input.JUMP); // oppa gangnam
|
||||||
|
|
||||||
if (this.forwardKeyDown = handler.isInputForcedDown(Input.MOVE_FORWARD)) {
|
if (this.forwardKeyDown = handler.isInputForcedDown(Input.MOVE_FORWARD)) {
|
||||||
this.moveForward++;
|
this.moveForward++;
|
||||||
|
|||||||
Reference in New Issue
Block a user