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;
18struct GoalId;
19// clang-format on
20
21class RandomSearchAndDigGoal : public ::BaseGoal {
22public:
23 // RandomSearchAndDigGoal inner types define
24 enum class CanUseOutcome : int {
25 Ok = 0,
26 InCooldown = 1,
27 NoNavigation = 2,
28 CouldNotFindTargetPos = 3,
29 CouldNotCreatePath = 4,
30 CouldNotPathAllTheWay = 5,
31 };
32
33 enum class State : int {
34 Searching = 0,
35 Digging = 1,
36 Success = 2,
37 Done = 3,
38 };
39
40public:
41 // member variables
42 // NOLINTBEGIN
43 ::ll::TypedStorage<4, 4, float> mSpeedMod;
44 ::ll::TypedStorage<4, 4, float> mGoalRadius;
45 ::ll::TypedStorage<4, 4, float> mDigSpawnItemPosOffset;
46 ::ll::TypedStorage<4, 4, float> mDigSpawnItemAfterSeconds;
47 ::ll::TypedStorage<4, 4, float> mTargetDigPositionOffset;
48 ::ll::TypedStorage<4, 4, int> mFindWantedPosRetries;
49 ::ll::TypedStorage<4, 4, int> mSearchRangeXZ;
50 ::ll::TypedStorage<4, 4, int> mSearchRangeY;
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 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
60 ::ll::TypedStorage<4, 4, ::RandomSearchAndDigGoal::State> mState;
61 ::ll::TypedStorage<4, 4, float> mGoalRadiusSqr;
62 ::ll::TypedStorage<1, 1, bool> mItemFound;
63 ::ll::TypedStorage<4, 12, ::BlockPos> mTargetPos;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Path>> mPath;
65 ::ll::TypedStorage<2, 2, ushort> mCooldownDurationTicks;
66 ::ll::TypedStorage<2, 2, ushort> mDiggingDurationTicks;
67 ::ll::TypedStorage<2, 2, ushort> mSpawnItemAfterTicks;
68 ::ll::TypedStorage<8, 8, ::Tick> mCooldownEndTick;
69 ::ll::TypedStorage<8, 8, ::Tick> mItemFoundEndTick;
70 ::ll::TypedStorage<8, 8, ::Tick> mDiggingEndTick;
71 ::ll::TypedStorage<8, 24, ::std::optional<::ExpiringTick>> mDiggingParticleCooldown;
72 // NOLINTEND
73
74public:
75 // prevent constructor by default
76 RandomSearchAndDigGoal& operator=(RandomSearchAndDigGoal const&);
77 RandomSearchAndDigGoal(RandomSearchAndDigGoal const&);
78 RandomSearchAndDigGoal();
79
80public:
81 // virtual functions
82 // NOLINTBEGIN
83 virtual bool canUse() /*override*/;
84
85 virtual bool canContinueToUse() /*override*/;
86
87 virtual void start() /*override*/;
88
89 virtual void stop() /*override*/;
90
91 virtual void tick() /*override*/;
92
93 virtual void appendDebugInfo(::std::string& str) const /*override*/;
94 // NOLINTEND
95
96public:
97 // member functions
98 // NOLINTBEGIN
99 MCAPI RandomSearchAndDigGoal(::Mob& mob, ::std::string name, ::GoalId const& goalId);
100
101 MCAPI ::std::optional<::BlockPos> _findWantedTargetPos() const;
102
103 MCAPI bool _isValidTarget(::BlockSource const& region, ::BlockPos const pos) const;
104 // NOLINTEND
105
106public:
107 // constructor thunks
108 // NOLINTBEGIN
109 MCAPI void* $ctor(::Mob& mob, ::std::string name, ::GoalId const& goalId);
110 // NOLINTEND
111
112public:
113 // virtual function thunks
114 // NOLINTBEGIN
115 MCAPI bool $canUse();
116
117 MCAPI bool $canContinueToUse();
118
119 MCAPI void $start();
120
121 MCAPI void $stop();
122
123 MCAPI void $tick();
124
125 MCAPI void $appendDebugInfo(::std::string& str) const;
126
127
128 // NOLINTEND
129};
Definition BaseGoal.h:12
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Mob.h:56
Definition Path.h:16
Definition GoalId.h:5