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/BaseGoal.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#include "mc/world/level/block/BlockDescriptor.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockSource;
16class Mob;
17class Path;
18// clang-format on
19
20class RandomSearchAndDigGoal : public ::BaseGoal {
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 // NOLINTEND
94
95public:
96 // member functions
97 // NOLINTBEGIN
98 MCAPI explicit RandomSearchAndDigGoal(::Mob& mob);
99
100 MCAPI ::RandomSearchAndDigGoal::CanUseOutcome _canUse();
101
102 MCAPI void _digUpItems();
103
104 MCAPI void _emitDiggingParticles();
105
106 MCAPI ::std::optional<::BlockPos> _findWantedTargetPos() const;
107
108 MCAPI bool _isValidTarget(::BlockSource const& region, ::BlockPos pos) const;
109
110 MCAPI void _resetCooldownEndTick();
111 // NOLINTEND
112
113public:
114 // constructor thunks
115 // NOLINTBEGIN
116 MCAPI void* $ctor(::Mob& mob);
117 // NOLINTEND
118
119public:
120 // virtual function thunks
121 // NOLINTBEGIN
122 MCAPI bool $canUse();
123
124 MCAPI bool $canContinueToUse();
125
126 MCAPI void $start();
127
128 MCAPI void $stop();
129
130 MCAPI void $tick();
131
132 MCAPI void $appendDebugInfo(::std::string& str) const;
133
134
135 // NOLINTEND
136
137public:
138 // vftables
139 // NOLINTBEGIN
140 MCNAPI static void** $vftable();
141 // NOLINTEND
142};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition Mob.h:57
Definition Path.h:16
static MCAPI void ** $vftable()