LeviLamina
Loading...
Searching...
No Matches
NavigationComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/world/level/block/BlockDescriptor.h"
8#include "mc/world/level/pathfinder/CanJumpIntoNode.h"
9#include "mc/world/level/pathfinder/NodeType.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
15class BlockPos;
16class Mob;
17class Path;
18class PathNavigation;
20// clang-format on
21
22class NavigationComponent {
23public:
24 // member variables
25 // NOLINTBEGIN
26 bool mAvoidDamageBlocks : 1;
27 bool mAvoidPortals : 1;
28 bool mAvoidSun : 1;
29 bool mAvoidWater : 1;
30 bool mCanBreach : 1;
31 bool mCanFloat : 1;
32 bool mCanPathOverLava : 1;
33 bool mCanWalkInLava : 1;
34 bool mCanJump : 1;
35 bool mCanOpenDoors : 1;
36 bool mCanOpenIronDoors : 1;
37 bool mCanPassDoors : 1;
38 bool mCanSink : 1;
39 bool mIsAmphibious : 1;
40 bool mIsFollowingRivers : 1;
41 bool mHasEndPathRadius : 1;
42 bool mHasDestination : 1;
43 ::ll::TypedStorage<4, 4, int> mTick;
44 ::ll::TypedStorage<4, 4, int> mTickTimeout;
45 ::ll::TypedStorage<4, 4, int> mLastStuckCheck;
46 ::ll::TypedStorage<4, 4, float> mEndPathRadiusSqr;
47 ::ll::TypedStorage<4, 4, float> mSpeed;
48 ::ll::TypedStorage<4, 4, float> mTerminationThreshold;
49 ::ll::TypedStorage<4, 12, ::Vec3> mLastStuckCheckPosition;
50 ::ll::TypedStorage<4, 12, ::Vec3> mTargetOffset;
51 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mBlocksToAvoid;
52 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PathNavigation>> mNavigation;
53 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Path>> mPath;
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
58 NavigationComponent& operator=(NavigationComponent const&);
59
60public:
61 // member functions
62 // NOLINTBEGIN
63 MCAPI NavigationComponent();
64
65 MCAPI NavigationComponent(::NavigationComponent const& other);
66
67 MCAPI ::std::unique_ptr<::Path> createPath(::Mob& owner, ::Vec3 const& position);
68
69 MCAPI ::std::unique_ptr<::Path> createPath(::Mob& owner, ::Actor const& target);
70
71 MCFOLD bool getAvoidDamageBlocks() const;
72
73 MCAPI bool getAvoidPortals() const;
74
75 MCAPI bool getAvoidSun() const;
76
77 MCAPI bool getAvoidWater() const;
78
79 MCFOLD ::std::vector<::BlockDescriptor> const& getBlocksToAvoid() const;
80
81 MCAPI bool getCanBreach() const;
82
83 MCAPI bool getCanFloat() const;
84
85 MCAPI bool getCanJump() const;
86
87 MCAPI bool getCanOpenDoors() const;
88
89 MCAPI bool getCanOpenIronDoors() const;
90
91 MCAPI bool getCanPassDoors() const;
92
93 MCAPI bool getCanPathOverLava() const;
94
95 MCAPI bool getCanSink() const;
96
97 MCAPI bool getCanWalkInLava() const;
98
99 MCFOLD float getEndPathRadiusSqr() const;
100
101 MCAPI bool getHasDestination() const;
102
103 MCAPI bool getHasEndPathRadius() const;
104
105 MCAPI bool getIsAmphibious() const;
106
107 MCAPI bool getIsFollowingRivers() const;
108
109 MCAPI ::Vec3 getLastStuckCheckPosition() const;
110
111 MCAPI float getMaxDistance(::Actor const& owner) const;
112
113 MCFOLD ::Path* getPath() const;
114
115 MCFOLD float getSpeed() const;
116
117 MCFOLD ::Vec3 const& getTargetOffset() const;
118
119 MCFOLD float getTerminationThreshold() const;
120
121 MCFOLD int getTickTimeout() const;
122
123 MCFOLD void incrementTick();
124
125 MCAPI void initMultiTypeNavigationComponent(::Mob& entity, ::ActorDefinitionDescriptor& initDescription);
126
127 MCAPI void initializeFromDefinition(::Mob& owner, ::NavigationDescription const* description);
128
129 MCAPI bool isDone() const;
130
131 MCAPI ::NodeType isFree(
132 ::Mob& owner,
133 ::BlockPos const& lastPathPos,
134 ::BlockPos const& testPos,
135 ::BlockPos const& size,
136 ::CanJumpIntoNode jumpIntoNode
137 );
138
139 MCAPI bool isStuck(int stuckTimeThreshold) const;
140
141 MCAPI bool moveTo(::Mob& owner, ::std::unique_ptr<::Path> newPath, float speed);
142
143 MCAPI bool moveTo(::Mob& owner, ::Vec3 const& position, float speed);
144
145 MCAPI bool moveTo(::Mob& owner, ::Actor const& target, float speed);
146
147 MCAPI bool moveTo(::Mob& owner, ::Vec3 const& position, float speed, ::Vec3 const& targetOffset);
148
149 MCAPI ::NavigationComponent& operator=(::NavigationComponent&&);
150
151 MCAPI void resetPath();
152
153 MCAPI void setAvoidDamageBlocks(bool avoidDamageBlocks);
154
155 MCAPI void setAvoidPortals(bool avoidPortals);
156
157 MCAPI void setAvoidSun(bool avoidSun);
158
159 MCAPI void setAvoidWater(bool avoidWater);
160
161 MCAPI void setCanFloat(bool canFloat);
162
163 MCAPI void setCanJump(bool canJump);
164
165 MCAPI void setCanOpenDoors(bool canOpenDoors);
166
167 MCAPI void setCanPassDoors(bool canPass);
168
169 MCAPI void setCanSink(bool canSink);
170
171 MCAPI void setEndPathRadius(float radius);
172
173 MCAPI void setHasDestination(bool hasDestination);
174
175 MCAPI void setHasEndPathRadius(bool hasEndPathRadius);
176
177 MCFOLD void setInternalType(::std::unique_ptr<::PathNavigation> type);
178
179 MCAPI void setIsFollowingRivers(bool isFollowingRivers);
180
181 MCAPI void setPath(::std::unique_ptr<::Path> path);
182
183 MCFOLD void setSpeed(float speed);
184
185 MCFOLD void setTargetOffset(::Vec3 const& targetOffset);
186
187 MCFOLD void setTerminationThreshold(float threshold);
188
189 MCFOLD void setTickTimeout(int timeout);
190
191 MCAPI void stop(::Mob& owner);
192
193 MCAPI bool travel(::Mob& owner, float& xa, float& ya, float& za);
194
195 MCAPI void update(::Mob& owner);
196
197 MCAPI void updateLastStuckCheck(::Mob const& owner);
198
199 MCAPI ~NavigationComponent();
200 // NOLINTEND
201
202public:
203 // constructor thunks
204 // NOLINTBEGIN
205 MCAPI void* $ctor();
206
207 MCAPI void* $ctor(::NavigationComponent const& other);
208 // NOLINTEND
209
210public:
211 // destructor thunk
212 // NOLINTBEGIN
213 MCAPI void $dtor();
214 // NOLINTEND
215};
Definition ActorDefinitionDescriptor.h:74
Definition Actor.h:125
Definition BlockPos.h:21
Definition Mob.h:57
Definition PathNavigation.h:22
Definition Path.h:16
Definition Vec3.h:10
Definition NavigationDescription.h:14