Added defaults and javadocs

This commit is contained in:
millennIumAMbiguity
2020-11-02 00:33:31 +01:00
parent 65a5677b33
commit 7218a46211
3 changed files with 26 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ public class FarmCommand extends Command {
public void execute(String label, IArgConsumer args) throws CommandException {
args.requireMax(2);
int range = 0;
BetterBlockPos origin;
BetterBlockPos origin = null;
//range
if (args.has(1)) {
range = args.getAs(Integer.class);
@@ -81,11 +81,8 @@ public class FarmCommand extends Command {
} else {
origin = waypoint.getLocation();
}
} else {
origin = baritone.getPlayerContext().playerFeet();
}
baritone.getFarmProcess().farm(range, origin);
logDirect("Farming");
}

View File

@@ -101,7 +101,11 @@ public final class FarmProcess extends BaritoneProcessHelper implements IFarmPro
@Override
public void farm(int range, BlockPos pos) {
center = pos;
if (pos == null) {
center = baritone.getPlayerContext().playerFeet();
} else {
center = pos;
}
this.range = range;
active = true;
locations = null;