Skip to content

Commit

Permalink
working commit (not done)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoursole1 committed Nov 24, 2022
1 parent aa0c0be commit ea03b0d
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,21 @@
/**
* Centers the NPC on its block
*/
public class CenterInstruction implements Instruction{
public class CenterInstruction implements Instruction {

private final Vector3 currentLocation;

public CenterInstruction(Vector3 currentLocation){
this.currentLocation = currentLocation;
}

@Override
public List<Vector3> generateMovementVectors() {
return null;
Vector3 floor = new Vector3(Math.floor(this.currentLocation.getX()), this.currentLocation.getY(), Math.floor(this.currentLocation.getZ()));
Vector3 center = new Vector3(floor.getX() + 0.5D, floor.getY(), floor.getZ() + 0.5D);

WalkInstruction ins = new WalkInstruction(currentLocation, center, 1);

return ins.generateMovementVectors();
}
}

0 comments on commit ea03b0d

Please sign in to comment.