LeviLamina
Loading...
Searching...
No Matches
JumpToBlockGoal.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/util/FloatRange.h"
8#include "mc/util/json_util/JsonSchemaObjectNode.h"
9#include "mc/world/actor/ai/goal/BaseGoalDefinition.h"
10#include "mc/world/actor/ai/goal/Goal.h"
11#include "mc/world/level/BlockPos.h"
12#include "mc/world/level/Tick.h"
13#include "mc/world/phys/AABB.h"
14
15// auto generated forward declare list
16// clang-format off
17class BlockSource;
18class EntityContext;
19class ItemDescriptor;
20class Mob;
22namespace JsonUtil { class EmptyClass; }
23// clang-format on
24
25class JumpToBlockGoal : public ::Goal {
26public:
27 // JumpToBlockGoal inner types declare
28 // clang-format off
29 class Definition;
31 // clang-format on
32
33 // JumpToBlockGoal inner types define
34 enum class JumpState : uchar {
35 LookingForBlock = 0,
36 FaceJump = 1,
37 Jump = 2,
38 Airborne = 3,
39 Done = 4,
40 };
41
43 public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<4, 4, int> mSearchWidth;
47 ::ll::TypedStorage<4, 4, int> mSearchHeight;
48 ::ll::TypedStorage<4, 4, int> mMinPathLength;
49 ::ll::TypedStorage<4, 4, int> mMinDistance;
50 ::ll::TypedStorage<4, 8, ::FloatRange> mCooldownTime;
51 ::ll::TypedStorage<4, 4, float> mScaleFactor;
52 ::ll::TypedStorage<4, 4, float> mMaxVelocity;
53 ::ll::TypedStorage<8, 24, ::std::vector<::ItemDescriptor>> mPreferredBlocks;
54 ::ll::TypedStorage<4, 4, float> mPreferredBlocksChance;
55 ::ll::TypedStorage<8, 24, ::std::vector<::ItemDescriptor>> mForbiddenBlocks;
56 // NOLINTEND
57
58 public:
59 // virtual functions
60 // NOLINTBEGIN
61 virtual ~Definition() /*override*/;
62 // NOLINTEND
63
64 public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI void initialize(::EntityContext& entity, ::JumpToBlockGoal& goal) const;
68 // NOLINTEND
69
70 public:
71 // static functions
72 // NOLINTBEGIN
73 MCAPI static void buildSchema(
74 ::std::string const& name,
76 root
77 );
78 // NOLINTEND
79
80 public:
81 // destructor thunk
82 // NOLINTBEGIN
83 MCAPI void $dtor();
84 // NOLINTEND
85
86 public:
87 // vftables
88 // NOLINTBEGIN
89 MCNAPI static void** $vftable();
90 // NOLINTEND
91 };
92
94 public:
95 // member variables
96 // NOLINTBEGIN
97 ::ll::TypedStorage<4, 12, ::BlockPos> targetPos;
98 ::ll::TypedStorage<4, 12, ::Vec3> velocityVector;
99 ::ll::TypedStorage<4, 4, int> mWeight;
100 // NOLINTEND
101 };
102
103public:
104 // member variables
105 // NOLINTBEGIN
106 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
107 ::ll::TypedStorage<1, 1, bool> mDiscardFrictionDefault;
108 ::ll::TypedStorage<8, 8, ::Tick> mCooldownTimeout;
109 ::ll::TypedStorage<8, 8, ::Tick> mNextCandidateCheck;
110 ::ll::TypedStorage<4, 4, int> mCandidateAttemptCounter;
111 ::ll::TypedStorage<1, 1, ::JumpToBlockGoal::JumpState> mState;
112 ::ll::TypedStorage<8, 24, ::std::vector<::Vec3>> mJumpCurve;
113 ::ll::TypedStorage<4, 12, ::BlockPos> mTargetBlockPos;
114 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mCandidateBlocksPositions;
115 ::ll::TypedStorage<4, 12, ::BlockPos> mStartingPos;
116 ::ll::TypedStorage<8, 24, ::std::vector<::JumpToBlockGoal::WeightedJumpToBlockPos>> mJumpableBlocksPositions;
117 ::ll::TypedStorage<4, 12, ::Vec3> mVelocityVector;
118 ::ll::TypedStorage<8, 8, ::Tick> mFaceJumpTimer;
119 ::ll::TypedStorage<8, 104, ::JumpToBlockGoal::Definition> mDefinition;
120 ::ll::TypedStorage<4, 24, ::AABB const> mOriginalAabb;
121 // NOLINTEND
122
123public:
124 // prevent constructor by default
125 JumpToBlockGoal& operator=(JumpToBlockGoal const&);
126 JumpToBlockGoal(JumpToBlockGoal const&);
127 JumpToBlockGoal();
128
129public:
130 // virtual functions
131 // NOLINTBEGIN
132 virtual bool canUse() /*override*/;
133
134 virtual bool canContinueToUse() /*override*/;
135
136 virtual void start() /*override*/;
137
138 virtual void stop() /*override*/;
139
140 virtual void tick() /*override*/;
141
142 virtual bool canBeInterrupted() /*override*/;
143
144 virtual void appendDebugInfo(::std::string& str) const /*override*/;
145
146 virtual ~JumpToBlockGoal() /*override*/;
147 // NOLINTEND
148
149public:
150 // member functions
151 // NOLINTBEGIN
152 MCAPI explicit JumpToBlockGoal(::Mob& mob);
153
154 MCAPI void _clearGoalState();
155
156 MCAPI bool _findCandidateBlocks(::NavigationComponent& navigation);
157
158 MCAPI bool _findJumpableBlocks(bool useOnlyPreferredBlocksIfAny);
159
160 MCAPI bool _findTargetBlock();
161
162 MCAPI bool _isValidPassThroughBlock(::BlockPos const& blockPos, ::NavigationComponent& navigation) const;
163
164 MCAPI bool _isValidTargetBlock(
165 ::BlockPos const& blockPos,
166 ::BlockSource const& region,
167 ::NavigationComponent& navigation
168 ) const;
169
170 MCAPI void resetCooldown();
171 // NOLINTEND
172
173public:
174 // constructor thunks
175 // NOLINTBEGIN
176 MCAPI void* $ctor(::Mob& mob);
177 // NOLINTEND
178
179public:
180 // destructor thunk
181 // NOLINTBEGIN
182 MCAPI void $dtor();
183 // NOLINTEND
184
185public:
186 // virtual function thunks
187 // NOLINTBEGIN
188 MCAPI bool $canUse();
189
190 MCAPI bool $canContinueToUse();
191
192 MCAPI void $start();
193
194 MCAPI void $stop();
195
196 MCAPI void $tick();
197
198 MCFOLD bool $canBeInterrupted();
199
200 MCAPI void $appendDebugInfo(::std::string& str) const;
201
202
203 // NOLINTEND
204
205public:
206 // vftables
207 // NOLINTBEGIN
208 MCNAPI static void** $vftable();
209 // NOLINTEND
210};
Definition BaseGoalDefinition.h:10
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition EntityContext.h:16
Definition Goal.h:14
Definition ItemDescriptor.h:23
Definition EmptyClass.h:7
Definition JsonSchemaObjectNode.h:8
Definition JumpToBlockGoal.h:42
static MCAPI void ** $vftable()
static MCAPI void ** $vftable()
Definition Mob.h:50
Definition NavigationComponent.h:19
Definition JumpToBlockGoal.h:93