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