25class RandomSearchAndDigGoal :
public ::Goal {
33 enum class CanUseOutcome :
int {
37 CouldNotFindTargetPos = 3,
38 CouldNotCreatePath = 4,
39 CouldNotPathAllTheWay = 5,
42 enum class State :
int {
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;
80 virtual ~Definition() ;
90 MCAPI
void initialize(
::EntityContext& entity, ::RandomSearchAndDigGoal& goal)
const;
96 MCAPI
static void buildSchema(
97 ::std::string
const& name,
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;
143 RandomSearchAndDigGoal& operator=(RandomSearchAndDigGoal
const&);
144 RandomSearchAndDigGoal(RandomSearchAndDigGoal
const&);
145 RandomSearchAndDigGoal();
150 virtual bool canUse() ;
152 virtual bool canContinueToUse() ;
154 virtual void start() ;
156 virtual void stop() ;
158 virtual void tick() ;
160 virtual void appendDebugInfo(::std::string& str)
const ;
162 virtual ~RandomSearchAndDigGoal() =
default;
168 MCAPI ::RandomSearchAndDigGoal::CanUseOutcome _canUse();
170 MCAPI
void _digUpItems();
172 MCAPI
void _emitDiggingParticles();
174 MCAPI ::std::optional<::BlockPos> _findWantedTargetPos()
const;
184 MCAPI
bool $canUse();
186 MCAPI
bool $canContinueToUse();
194 MCAPI
void $appendDebugInfo(::std::string& str)
const;
Definition EntityContext.h:16