the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3class Mob;
4class Level;
5class Path;
6
7class PathNavigation
8{
9private:
10 Mob *mob;
11 Level *level;
12 Path *path;
13 double speedModifier;
14 AttributeInstance *dist;
15 bool avoidSun;
16 int _tick;
17 int lastStuckCheck;
18 Vec3 *lastStuckCheckPos;
19
20 bool _canPassDoors;
21 bool _canOpenDoors;
22 bool avoidWater;
23 bool canFloat;
24
25public:
26 PathNavigation(Mob *mob, Level *level);
27 ~PathNavigation();
28
29 void setAvoidWater(bool avoidWater);
30 bool getAvoidWater();
31 void setCanOpenDoors(bool canOpenDoors);
32 bool canPassDoors();
33 void setCanPassDoors(bool canPass);
34 bool canOpenDoors();
35 void setAvoidSun(bool avoidSun);
36 void setSpeedModifier(double speedModifier);
37 void setCanFloat(bool canFloat);
38 float getMaxDist();
39 Path *createPath(double x, double y, double z);
40 bool moveTo(double x, double y, double z, double speedModifier);
41 Path *createPath(shared_ptr<Entity> target);
42 bool moveTo(shared_ptr<Entity> target, double speedModifier);
43 bool moveTo(Path *newPath, double speedModifier);
44 Path *getPath();
45 void tick();
46
47private:
48 void updatePath();
49
50public:
51 bool isDone();
52
53 void stop();
54
55private:
56 Vec3 *getTempMobPos();
57 int getSurfaceY();
58 bool canUpdatePath();
59 bool isInLiquid();
60 void trimPathFromSun();
61 bool canMoveDirectly(Vec3 *startPos, Vec3 *stopPos, int sx, int sy, int sz);
62 bool canWalkOn(int x, int y, int z, int sx, int sy, int sz, Vec3 *startPos, double goalDirX, double goalDirZ);
63 bool canWalkAbove(int startX, int startY, int startZ, int sx, int sy, int sz, Vec3 *startPos, double goalDirX, double goalDirZ);
64
65public:
66 // 4J Added override to update ai elements when loading entity from schematics
67 void setLevel(Level *level);
68};