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/world/actor/ActorDefinitionTrigger.h"
7#include "mc/world/actor/ai/goal/Goal.h"
8#include "mc/world/actor/ai/util/ExpiringTick.h"
9#include "mc/world/level/BlockPos.h"
10#include "mc/world/level/Tick.h"
11
12// auto generated forward declare list
13// clang-format off
14class BlockDescriptor;
15class BlockSource;
16class Mob;
17class Path;
18// clang-format on
19
20class RandomSearchAndDigGoal : public ::Goal {
21public:
22 // RandomSearchAndDigGoal inner types define
23 enum class CanUseOutcome : int {
24 Ok = 0,
25 InCooldown = 1,
26 NoNavigation = 2,
27 CouldNotFindTargetPos = 3,
28 CouldNotCreatePath = 4,
29 CouldNotPathAllTheWay = 5,
30 };
31
32 enum class State : int {
33 Searching = 0,
34 Digging = 1,
35 Success = 2,
36 Done = 3,
37 };
38
39public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<4, 4, float> mSpeedMod;
43 ::ll::TypedStorage<4, 4, float> mGoalRadius;
44 ::ll::TypedStorage<4, 4, float> mDigSpawnItemPosOffset;
45 ::ll::TypedStorage<4, 4, float> mDigSpawnItemAfterSeconds;
46 ::ll::TypedStorage<4, 4, float> mTargetDigPositionOffset;
47 ::ll::TypedStorage<4, 4, int> mFindWantedPosRetries;
48 ::ll::TypedStorage<4, 4, int> mSearchRangeXZ;
49 ::ll::TypedStorage<4, 4, int> mSearchRangeY;
50 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnSearchingStartEvent;
51 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnFailDuringSearchingEvent;
52 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnDiggingStartEvent;
53 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnItemFoundEvent;
54 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnFailDuringDiggingEvent;
55 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnSuccessEvent;
56 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mTargetBlocks;
57 ::ll::TypedStorage<8, 32, ::std::string> mItemTable;
58 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
59 ::ll::TypedStorage<4, 4, ::RandomSearchAndDigGoal::State> mState;
60 ::ll::TypedStorage<4, 4, float> mGoalRadiusSqr;
61 ::ll::TypedStorage<1, 1, bool> mItemFound;
62 ::ll::TypedStorage<4, 12, ::BlockPos> mTargetPos;
63 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Path>> mPath;
64 ::ll::TypedStorage<2, 2, ushort> mCooldownDurationTicks;
65 ::ll::TypedStorage<2, 2, ushort> mDiggingDurationTicks;
66 ::ll::TypedStorage<2, 2, ushort> mSpawnItemAfterTicks;
67 ::ll::TypedStorage<8, 8, ::Tick> mCooldownEndTick;
68 ::ll::TypedStorage<8, 8, ::Tick> mItemFoundEndTick;
69 ::ll::TypedStorage<8, 8, ::Tick> mDiggingEndTick;
70 ::ll::TypedStorage<8, 24, ::std::optional<::ExpiringTick>> mDiggingParticleCooldown;
71 // NOLINTEND
72
73public:
74 // prevent constructor by default
75 RandomSearchAndDigGoal& operator=(RandomSearchAndDigGoal const&);
76 RandomSearchAndDigGoal(RandomSearchAndDigGoal const&);
77 RandomSearchAndDigGoal();
78
79public:
80 // virtual functions
81 // NOLINTBEGIN
82 virtual bool canUse() /*override*/;
83
84 virtual bool canContinueToUse() /*override*/;
85
86 virtual void start() /*override*/;
87
88 virtual void stop() /*override*/;
89
90 virtual void tick() /*override*/;
91
92 virtual void appendDebugInfo(::std::string& str) const /*override*/;
93
94 virtual ~RandomSearchAndDigGoal() /*override*/;
95 // NOLINTEND
96
97public:
98 // member functions
99 // NOLINTBEGIN
100 MCAPI explicit RandomSearchAndDigGoal(::Mob& mob);
101
102 MCAPI ::RandomSearchAndDigGoal::CanUseOutcome _canUse();
103
104 MCAPI void _digUpItems();
105
106 MCAPI void _emitDiggingParticles();
107
108 MCAPI ::std::optional<::BlockPos> _findWantedTargetPos() const;
109
110 MCAPI bool _isValidTarget(::BlockSource const& region, ::BlockPos pos) const;
111
112 MCAPI void _triggerEvent(::ActorDefinitionTrigger const& eventTrigger) const;
113 // NOLINTEND
114
115public:
116 // constructor thunks
117 // NOLINTBEGIN
118 MCAPI void* $ctor(::Mob& mob);
119 // NOLINTEND
120
121public:
122 // destructor thunk
123 // NOLINTBEGIN
124 MCAPI void $dtor();
125 // NOLINTEND
126
127public:
128 // virtual function thunks
129 // NOLINTBEGIN
130 MCAPI bool $canUse();
131
132 MCAPI bool $canContinueToUse();
133
134 MCAPI void $start();
135
136 MCAPI void $stop();
137
138 MCAPI void $tick();
139
140 MCAPI void $appendDebugInfo(::std::string& str) const;
141
142
143 // NOLINTEND
144
145public:
146 // vftables
147 // NOLINTBEGIN
148 MCNAPI static void** $vftable();
149 // NOLINTEND
150};
Definition ActorDefinitionTrigger.h:14
Definition BlockDescriptor.h:20
Definition BlockPos.h:19
Definition BlockSource.h:71
Definition Goal.h:14
Definition Mob.h:51
Definition Path.h:16
static MCAPI void ** $vftable()