LeviLamina
Loading...
Searching...
No Matches
JumpToBlockGoal.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/deps/shared_types/shared_types/FloatRange.h"
8#include "mc/world/actor/ai/goal/BaseGoal.h"
9#include "mc/world/level/BlockPos.h"
10#include "mc/world/level/Tick.h"
11#include "mc/world/phys/AABB.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockSource;
16class ItemDescriptor;
17class Mob;
20// clang-format on
21
22class JumpToBlockGoal : public ::BaseGoal {
23public:
24 // JumpToBlockGoal inner types declare
25 // clang-format off
27 // clang-format on
28
29 // JumpToBlockGoal inner types define
30 enum class JumpState : uchar {
31 LookingForBlock = 0,
32 FaceJump = 1,
33 Jump = 2,
34 Airborne = 3,
35 Done = 4,
36 };
37
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<4, 12, ::BlockPos> targetPos;
43 ::ll::TypedStorage<4, 12, ::Vec3> velocityVector;
44 ::ll::TypedStorage<4, 4, int> mWeight;
45 // NOLINTEND
46 };
47
48public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 8, ::Mob&> mMob;
52 ::ll::TypedStorage<1, 1, bool> mDiscardFrictionDefault;
53 ::ll::TypedStorage<8, 8, ::Tick> mCooldownTimeout;
54 ::ll::TypedStorage<8, 8, ::Tick> mNextCandidateCheck;
55 ::ll::TypedStorage<4, 4, int> mCandidateAttemptCounter;
56 ::ll::TypedStorage<1, 1, ::JumpToBlockGoal::JumpState> mState;
57 ::ll::TypedStorage<8, 24, ::std::vector<::Vec3>> mJumpCurve;
58 ::ll::TypedStorage<4, 12, ::BlockPos> mTargetBlockPos;
59 ::ll::TypedStorage<8, 24, ::std::vector<::BlockPos>> mCandidateBlocksPositions;
60 ::ll::TypedStorage<4, 12, ::BlockPos> mStartingPos;
61 ::ll::TypedStorage<8, 24, ::std::vector<::JumpToBlockGoal::WeightedJumpToBlockPos>> mJumpableBlocksPositions;
62 ::ll::TypedStorage<4, 12, ::Vec3> mVelocityVector;
63 ::ll::TypedStorage<8, 8, ::Tick> mFaceJumpTimer;
64 ::ll::TypedStorage<4, 24, ::AABB const> mOriginalAabb;
65 ::ll::TypedStorage<4, 4, int> mSearchWidth;
66 ::ll::TypedStorage<4, 4, int> mSearchHeight;
67 ::ll::TypedStorage<4, 4, int> mMinPathLength;
68 ::ll::TypedStorage<4, 4, int> mMinDistance;
69 ::ll::TypedStorage<4, 8, ::SharedTypes::FloatRange> mCooldownTime;
70 ::ll::TypedStorage<4, 4, float> mScaleFactor;
71 ::ll::TypedStorage<4, 4, float> mMaxVelocity;
72 ::ll::TypedStorage<8, 24, ::std::vector<::ItemDescriptor>> mPreferredBlocks;
73 ::ll::TypedStorage<4, 4, float> mPreferredBlocksChance;
74 ::ll::TypedStorage<8, 24, ::std::vector<::ItemDescriptor>> mForbiddenBlocks;
75 // NOLINTEND
76
77public:
78 // prevent constructor by default
79 JumpToBlockGoal& operator=(JumpToBlockGoal const&);
80 JumpToBlockGoal(JumpToBlockGoal const&);
81 JumpToBlockGoal();
82
83public:
84 // virtual functions
85 // NOLINTBEGIN
86 virtual bool canUse() /*override*/;
87
88 virtual bool canContinueToUse() /*override*/;
89
90 virtual void start() /*override*/;
91
92 virtual void stop() /*override*/;
93
94 virtual void tick() /*override*/;
95
96 virtual bool canBeInterrupted() /*override*/;
97
98 virtual void appendDebugInfo(::std::string& str) const /*override*/;
99 // NOLINTEND
100
101public:
102 // member functions
103 // NOLINTBEGIN
104 MCAPI explicit JumpToBlockGoal(::Mob& mob);
105
106 MCAPI void _clearGoalState();
107
108 MCAPI bool _findCandidateBlocks(::NavigationComponent& navigation);
109
110 MCAPI bool _findJumpableBlocks(bool useOnlyPreferredBlocksIfAny);
111
112 MCAPI bool _findTargetBlock();
113
114 MCAPI bool _isValidTargetBlock(
115 ::BlockPos const& blockPos,
116 ::BlockSource const& region,
117 ::NavigationComponent& navigation
118 ) const;
119
120 MCAPI bool _turnToTarget(::MoveControlComponent const& moveControl) const;
121
122 MCAPI void resetCooldown();
123 // NOLINTEND
124
125public:
126 // constructor thunks
127 // NOLINTBEGIN
128 MCAPI void* $ctor(::Mob& mob);
129 // NOLINTEND
130
131public:
132 // virtual function thunks
133 // NOLINTBEGIN
134 MCAPI bool $canUse();
135
136 MCAPI bool $canContinueToUse();
137
138 MCAPI void $start();
139
140 MCAPI void $stop();
141
142 MCAPI void $tick();
143
144 MCFOLD bool $canBeInterrupted();
145
146 MCAPI void $appendDebugInfo(::std::string& str) const;
147
148
149 // NOLINTEND
150
151public:
152 // vftables
153 // NOLINTBEGIN
154 MCNAPI static void** $vftable();
155 // NOLINTEND
156};
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition ItemDescriptor.h:25
static MCAPI void ** $vftable()
Definition Mob.h:57
Definition MoveControlComponent.h:16
Definition NavigationComponent.h:22
Definition JumpToBlockGoal.h:38