forked from RepoMirrors/baritone
Merge branch 'comms' into calc-request
This commit is contained in:
commit
27c818f873
|
@ -35,6 +35,9 @@ public class MessageStatus implements iMessage {
|
||||||
public final float health;
|
public final float health;
|
||||||
public final float saturation;
|
public final float saturation;
|
||||||
public final int foodLevel;
|
public final int foodLevel;
|
||||||
|
public final int pathStartX;
|
||||||
|
public final int pathStartY;
|
||||||
|
public final int pathStartZ;
|
||||||
public final boolean hasCurrentSegment;
|
public final boolean hasCurrentSegment;
|
||||||
public final boolean hasNextSegment;
|
public final boolean hasNextSegment;
|
||||||
public final boolean calcInProgress;
|
public final boolean calcInProgress;
|
||||||
|
@ -54,6 +57,9 @@ public class MessageStatus implements iMessage {
|
||||||
this.health = in.readFloat();
|
this.health = in.readFloat();
|
||||||
this.saturation = in.readFloat();
|
this.saturation = in.readFloat();
|
||||||
this.foodLevel = in.readInt();
|
this.foodLevel = in.readInt();
|
||||||
|
this.pathStartX = in.readInt();
|
||||||
|
this.pathStartY = in.readInt();
|
||||||
|
this.pathStartZ = in.readInt();
|
||||||
this.hasCurrentSegment = in.readBoolean();
|
this.hasCurrentSegment = in.readBoolean();
|
||||||
this.hasNextSegment = in.readBoolean();
|
this.hasNextSegment = in.readBoolean();
|
||||||
this.calcInProgress = in.readBoolean();
|
this.calcInProgress = in.readBoolean();
|
||||||
|
@ -64,7 +70,7 @@ public class MessageStatus implements iMessage {
|
||||||
this.currentProcess = in.readUTF();
|
this.currentProcess = in.readUTF();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageStatus(double x, double y, double z, float yaw, float pitch, boolean onGround, float health, float saturation, int foodLevel, boolean hasCurrentSegment, boolean hasNextSegment, boolean calcInProgress, double ticksRemainingInCurrent, boolean calcFailedLastTick, boolean safeToCancel, String currentGoal, String currentProcess) {
|
public MessageStatus(double x, double y, double z, float yaw, float pitch, boolean onGround, float health, float saturation, int foodLevel, int pathStartX, int pathStartY, int pathStartZ, boolean hasCurrentSegment, boolean hasNextSegment, boolean calcInProgress, double ticksRemainingInCurrent, boolean calcFailedLastTick, boolean safeToCancel, String currentGoal, String currentProcess) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
|
@ -74,6 +80,9 @@ public class MessageStatus implements iMessage {
|
||||||
this.health = health;
|
this.health = health;
|
||||||
this.saturation = saturation;
|
this.saturation = saturation;
|
||||||
this.foodLevel = foodLevel;
|
this.foodLevel = foodLevel;
|
||||||
|
this.pathStartX = pathStartX;
|
||||||
|
this.pathStartY = pathStartY;
|
||||||
|
this.pathStartZ = pathStartZ;
|
||||||
this.hasCurrentSegment = hasCurrentSegment;
|
this.hasCurrentSegment = hasCurrentSegment;
|
||||||
this.hasNextSegment = hasNextSegment;
|
this.hasNextSegment = hasNextSegment;
|
||||||
this.calcInProgress = calcInProgress;
|
this.calcInProgress = calcInProgress;
|
||||||
|
@ -95,6 +104,9 @@ public class MessageStatus implements iMessage {
|
||||||
out.writeFloat(health);
|
out.writeFloat(health);
|
||||||
out.writeFloat(saturation);
|
out.writeFloat(saturation);
|
||||||
out.writeInt(foodLevel);
|
out.writeInt(foodLevel);
|
||||||
|
out.writeInt(pathStartX);
|
||||||
|
out.writeInt(pathStartY);
|
||||||
|
out.writeInt(pathStartZ);
|
||||||
out.writeBoolean(hasCurrentSegment);
|
out.writeBoolean(hasCurrentSegment);
|
||||||
out.writeBoolean(hasNextSegment);
|
out.writeBoolean(hasNextSegment);
|
||||||
out.writeBoolean(calcInProgress);
|
out.writeBoolean(calcInProgress);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import comms.IMessageListener;
|
||||||
import comms.downward.MessageChat;
|
import comms.downward.MessageChat;
|
||||||
import comms.iMessage;
|
import comms.iMessage;
|
||||||
import comms.upward.MessageStatus;
|
import comms.upward.MessageStatus;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -49,7 +50,9 @@ public class ControllerBehavior extends Behavior implements IMessageListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessageStatus buildStatus() {
|
public MessageStatus buildStatus() {
|
||||||
// TODO inventory
|
// TODO report inventory and echest contents
|
||||||
|
// TODO figure out who should remember echest contents when it isn't open, baritone or tenor?
|
||||||
|
BlockPos pathStart = baritone.getPathingBehavior().pathStart();
|
||||||
return new MessageStatus(
|
return new MessageStatus(
|
||||||
ctx.player().posX,
|
ctx.player().posX,
|
||||||
ctx.player().posY,
|
ctx.player().posY,
|
||||||
|
@ -60,6 +63,9 @@ public class ControllerBehavior extends Behavior implements IMessageListener {
|
||||||
ctx.player().getHealth(),
|
ctx.player().getHealth(),
|
||||||
ctx.player().getFoodStats().getSaturationLevel(),
|
ctx.player().getFoodStats().getSaturationLevel(),
|
||||||
ctx.player().getFoodStats().getFoodLevel(),
|
ctx.player().getFoodStats().getFoodLevel(),
|
||||||
|
pathStart.getX(),
|
||||||
|
pathStart.getY(),
|
||||||
|
pathStart.getZ(),
|
||||||
baritone.getPathingBehavior().getCurrent() != null,
|
baritone.getPathingBehavior().getCurrent() != null,
|
||||||
baritone.getPathingBehavior().getNext() != null,
|
baritone.getPathingBehavior().getNext() != null,
|
||||||
baritone.getPathingBehavior().getInProgress().isPresent(),
|
baritone.getPathingBehavior().getInProgress().isPresent(),
|
||||||
|
|
Loading…
Reference in New Issue