relative goals
This commit is contained in:
parent
0dd4834e18
commit
6861bfd4e6
@ -688,18 +688,20 @@ public class ExampleBaritoneControl implements Helper, AbstractGameEventListener
|
|||||||
private Goal parseGoal(String[] params) {
|
private Goal parseGoal(String[] params) {
|
||||||
Goal goal;
|
Goal goal;
|
||||||
try {
|
try {
|
||||||
|
BetterBlockPos playerFeet = ctx.playerFeet();
|
||||||
switch (params.length) {
|
switch (params.length) {
|
||||||
case 0:
|
case 0:
|
||||||
goal = new GoalBlock(ctx.playerFeet());
|
goal = new GoalBlock(playerFeet);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
goal = new GoalYLevel(Integer.parseInt(params[0]));
|
|
||||||
|
goal = new GoalYLevel(parseOrDefault(params[0], playerFeet.y));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
goal = new GoalXZ(Integer.parseInt(params[0]), Integer.parseInt(params[1]));
|
goal = new GoalXZ(parseOrDefault(params[0], playerFeet.x), parseOrDefault(params[1], playerFeet.z));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
goal = new GoalBlock(new BlockPos(Integer.parseInt(params[0]), Integer.parseInt(params[1]), Integer.parseInt(params[2])));
|
goal = new GoalBlock(new BlockPos(parseOrDefault(params[0], playerFeet.x), parseOrDefault(params[1], playerFeet.y), parseOrDefault(params[2], playerFeet.z)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
logDirect("unable to understand lol");
|
logDirect("unable to understand lol");
|
||||||
|
Loading…
Reference in New Issue
Block a user