LeviLamina
Loading...
Searching...
No Matches
RandomSearchAndDigGoal.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/util/FloatRange.h"
7#include "mc/util/json_util/JsonSchemaObjectNode.h"
8#include "mc/world/actor/ActorDefinitionTrigger.h"
9#include "mc/world/actor/ai/goal/BaseGoalDefinition.h"
10#include "mc/world/actor/ai/goal/Goal.h"
11#include "mc/world/actor/ai/util/ExpiringTick.h"
12#include "mc/world/level/BlockPos.h"
13#include "mc/world/level/Tick.h"
14
15// auto generated forward declare list
16// clang-format off
17class BlockDescriptor;
18class BlockSource;
19class EntityContext;
20class Mob;
21class Path;
22namespace JsonUtil { class EmptyClass; }
23// clang-format on
24
26public:
27 // RandomSearchAndDigGoal inner types declare
28 // clang-format off
29 class Definition;
30 // clang-format on
31
32 // RandomSearchAndDigGoal inner types define
34 public:
35 // Definition inner types define
37
38 public:
39 // member variables
40 // NOLINTBEGIN
41 ::ll::TypedStorage<4, 4, float> mSpeedMod;
42 ::ll::TypedStorage<4, 4, float> mGoalRadius;
43 ::ll::TypedStorage<4, 4, float> mDigSpawnItemPosOffset;
44 ::ll::TypedStorage<4, 4, float> mDigSpawnItemAfterSeconds;
45 ::ll::TypedStorage<4, 4, int> mFindWantedPosRetries;
46 ::ll::TypedStorage<4, 4, int> mSearchRangeXZ;
47 ::ll::TypedStorage<4, 4, int> mSearchRangeY;
48 ::ll::TypedStorage<4, 4, float> mTargetDigPositionOffset;
49 ::ll::TypedStorage<4, 8, ::FloatRange> mDiggingDurationRange;
50 ::ll::TypedStorage<4, 8, ::FloatRange> mCooldownRangeSeconds;
51 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnSearchingStartEvent;
52 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnFailDuringSearchingEvent;
53 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnDiggingStartEvent;
54 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnItemFoundEvent;
55 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnFailDuringDiggingEvent;
56 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnSuccessEvent;
57 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mTargetBlocks;
58 ::ll::TypedStorage<8, 32, ::std::string> mItemTable;
59 // NOLINTEND
60
61 public:
62 // prevent constructor by default
63 Definition(Definition const&);
64
65 public:
66 // virtual functions
67 // NOLINTBEGIN
68 // vIndex: 0
69 virtual ~Definition() /*override*/;
70 // NOLINTEND
71
72 public:
73 // member functions
74 // NOLINTBEGIN
75 MCAPI Definition();
76
77 MCAPI void addBlockDescriptor(::BlockDescriptor const& blockDescriptor);
78
79 MCAPI void initialize(::EntityContext& entity, ::RandomSearchAndDigGoal& goal) const;
80
81 MCAPI ::RandomSearchAndDigGoal::Definition& operator=(::RandomSearchAndDigGoal::Definition const&);
82 // NOLINTEND
83
84 public:
85 // static functions
86 // NOLINTBEGIN
87 MCAPI static void buildSchema(
88 ::std::string const& name,
89 ::std::shared_ptr<
91 );
92 // NOLINTEND
93
94 public:
95 // constructor thunks
96 // NOLINTBEGIN
97 MCAPI void* $ctor();
98 // NOLINTEND
99
100 public:
101 // destructor thunk
102 // NOLINTBEGIN
103 MCAPI void $dtor();
104 // NOLINTEND
105
106 public:
107 // vftables
108 // NOLINTBEGIN
109 MCNAPI static void** $vftable();
110 // NOLINTEND
111 };
112
113 enum class CanUseOutcome : int {
114 Ok = 0,
115 InCooldown = 1,
116 NoNavigation = 2,
117 CouldNotFindTargetPos = 3,
118 CouldNotCreatePath = 4,
119 CouldNotPathAllTheWay = 5,
120 };
121
122 enum class State : int {
123 Searching = 0,
124 Digging = 1,
125 Success = 2,
126 Done = 3,
127 };
128
129public:
130 // member variables
131 // NOLINTBEGIN
132 ::ll::TypedStorage<8, 744, ::RandomSearchAndDigGoal::Definition> mDefinition;
133 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
134 ::ll::TypedStorage<4, 4, ::RandomSearchAndDigGoal::State> mState;
135 ::ll::TypedStorage<4, 4, float> mGoalRadiusSqr;
136 ::ll::TypedStorage<1, 1, bool> mItemFound;
137 ::ll::TypedStorage<4, 12, ::BlockPos> mTargetPos;
138 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Path>> mPath;
139 ::ll::TypedStorage<2, 2, ushort> mCooldownDurationTicks;
140 ::ll::TypedStorage<2, 2, ushort> mDiggingDurationTicks;
141 ::ll::TypedStorage<2, 2, ushort> mSpawnItemAfterTicks;
142 ::ll::TypedStorage<8, 8, ::Tick> mCooldownEndTick;
143 ::ll::TypedStorage<8, 8, ::Tick> mItemFoundEndTick;
144 ::ll::TypedStorage<8, 8, ::Tick> mDiggingEndTick;
145 ::ll::TypedStorage<8, 24, ::std::optional<::ExpiringTick>> mDiggingParticleCooldown;
146 // NOLINTEND
147
148public:
149 // prevent constructor by default
153
154public:
155 // virtual functions
156 // NOLINTBEGIN
157 // vIndex: 1
158 virtual bool canUse() /*override*/;
159
160 // vIndex: 2
161 virtual bool canContinueToUse() /*override*/;
162
163 // vIndex: 4
164 virtual void start() /*override*/;
165
166 // vIndex: 5
167 virtual void stop() /*override*/;
168
169 // vIndex: 6
170 virtual void tick() /*override*/;
171
172 // vIndex: 7
173 virtual void appendDebugInfo(::std::string& str) const /*override*/;
174
175 // vIndex: 0
176 virtual ~RandomSearchAndDigGoal() /*override*/ = default;
177 // NOLINTEND
178
179public:
180 // member functions
181 // NOLINTBEGIN
182 MCAPI ::RandomSearchAndDigGoal::CanUseOutcome _canUse();
183
184 MCAPI void _digUpItems();
185
186 MCAPI void _emitDiggingParticles();
187
188 MCAPI ::std::optional<::BlockPos> _findWantedTargetPos() const;
189
190 MCAPI bool _isValidTarget(::BlockSource const& region, ::BlockPos pos) const;
191
192 MCAPI void _triggerEvent(::ActorDefinitionTrigger const& eventTrigger) const;
193 // NOLINTEND
194
195public:
196 // virtual function thunks
197 // NOLINTBEGIN
198 MCAPI bool $canUse();
199
200 MCAPI bool $canContinueToUse();
201
202 MCAPI void $start();
203
204 MCAPI void $stop();
205
206 MCAPI void $tick();
207
208 MCAPI void $appendDebugInfo(::std::string& str) const;
209 // NOLINTEND
210
211public:
212 // vftables
213 // NOLINTBEGIN
214 MCNAPI static void** $vftable();
215 // NOLINTEND
216};
Definition ActorDefinitionTrigger.h:5
Definition BaseGoalDefinition.h:10
Definition BlockDescriptor.h:20
Definition BlockPos.h:17
Definition BlockSource.h:66
Definition EntityContext.h:16
Definition Goal.h:14
Definition JsonSchemaObjectNode.h:8
Definition Mob.h:47
Definition Path.h:16
Definition RandomSearchAndDigGoal.h:33
static MCAPI void ** $vftable()
Definition RandomSearchAndDigGoal.h:25
static MCAPI void ** $vftable()