LeviLamina
Loading...
Searching...
No Matches
Agent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec2.h"
7#include "mc/world/actor/ActorEvent.h"
8#include "mc/world/actor/ActorInitializationMethod.h"
9#include "mc/world/actor/Mob.h"
10#include "mc/world/actor/agent/AgentAnimation.h"
11#include "mc/world/actor/agent/AgentRenderData.h"
12#include "mc/world/actor/agent/AgentTravelType.h"
13#include "mc/world/level/GameType.h"
14
15// auto generated forward declare list
16// clang-format off
17class AABB;
18class Actor;
21class ActorHurtResult;
22class BodyControl;
23class EntityContext;
24class ItemStack;
25class Player;
26class Vec3;
28struct ActorUniqueID;
31namespace mce { class Color; }
32// clang-format on
33
34class Agent : public ::Mob {
35public:
36 // Agent inner types define
37 enum class AnimState : int {
38 Idle = 0,
39 Moving = 1,
40 ArmSwing = 2,
41 Shrug = 3,
42 };
43
44public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<1, 1, bool> mIsHovering;
48 ::ll::TypedStorage<4, 8, ::Vec2> mHorizontalTarget;
49 ::ll::TypedStorage<4, 4, float> mVerticalTarget;
50 ::ll::TypedStorage<4, 4, int> mSelectedSlot;
51 ::ll::TypedStorage<1, 1, bool> mHasSetName;
52 ::ll::TypedStorage<1, 1, bool> mHasFiredCreationEvent;
53 ::ll::TypedStorage<8, 16, ::AgentRenderData> mRenderData;
54 // NOLINTEND
55
56public:
57 // prevent constructor by default
58 Agent();
59
60public:
61 // virtual functions
62 // NOLINTBEGIN
63 virtual ::mce::Color getNameTagTextColor() const /*override*/;
64
65 virtual bool canShowNameTag() const /*override*/;
66
67 virtual bool canBePulledIntoVehicle() const /*override*/;
68
69 virtual bool canBeAffected(uint id) const /*override*/;
70
71 virtual void knockback(::Actor*, int, float, float, ::KnockbackParameters const&) /*override*/;
72
73 virtual void handleEntityEvent(::ActorEvent id, int data) /*override*/;
74
75 virtual void
76 initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params) /*override*/;
77
78 virtual bool createAIGoals() /*override*/;
79
80 virtual void setCarriedItem(::ItemStack const& item) /*override*/;
81
82 virtual void normalTick() /*override*/;
83
84 virtual void baseTick() /*override*/;
85
86 virtual void
87 teleportTo(::Vec3 const& pos, bool shouldStopRiding, int cause, int entityType, bool keepVelocity) /*override*/;
88
89 virtual bool canExistWhenDisallowMob() const /*override*/;
90
91 virtual bool isTargetable() const /*override*/;
92
93 virtual bool isInvisible() const /*override*/;
94
95 virtual void kill() /*override*/;
96
97 virtual void setOwner(::ActorUniqueID const id) /*override*/;
98
99 virtual ::ActorHurtResult
100 _hurt(::ActorDamageSource const& source, float damage, bool knock, bool ignite) /*override*/;
101
102 virtual ::std::unique_ptr<::BodyControl> initBodyControl() /*override*/;
103 // NOLINTEND
104
105public:
106 // member functions
107 // NOLINTBEGIN
108 MCAPI Agent(
109 ::ActorDefinitionGroup* definitions,
110 ::ActorDefinitionIdentifier const& definitionName,
111 ::EntityContext& entityContext
112 );
113
114 MCAPI ::AgentTravelType checkTravelType();
115
116 MCAPI void doClientTravel(::AABB const& aabb);
117
118 MCAPI ::Vec3 doServerTravel(::AABB const& aabb, ::AgentTravelType travelType);
119
120 MCAPI float getMoveSpeedScalar() const;
121
122 MCFOLD ::AgentRenderData& getRenderData();
123
124 MCFOLD int getSelectedSlot() const;
125
126 MCAPI int getSwingAnimationDuration() const;
127
128 MCAPI void handleAnimationEvent(::AgentAnimation anim);
129
130 MCAPI bool isArmSwinging() const;
131
132 MCAPI bool isIdling();
133
134 MCAPI bool isShrugging() const;
135
136 MCAPI bool isValidSlotNum(int slotNum);
137
138 MCAPI void setGameType(::GameType gameType);
139
140 MCAPI void setMoveTarget(float target);
141
142 MCAPI void setMoveTarget(::Vec2 target);
143
144 MCAPI void setNameTagFromOwner(::Player const& player);
145
146 MCAPI void shrug();
147
148 MCAPI void startCommandMode();
149
150 MCAPI void stopCommandMode();
151
152 MCAPI void swingArm();
153
154 MCAPI void tryFireCreateEvent(::Player& player);
155 // NOLINTEND
156
157public:
158 // static functions
159 // NOLINTBEGIN
160 MCAPI static ::Vec3 roundTeleportPos(::Vec3 const& pos);
161
162 MCAPI static ::Agent* tryGetFromEntity(::EntityContext& entity, bool includeRemoved);
163 // NOLINTEND
164
165public:
166 // constructor thunks
167 // NOLINTBEGIN
168 MCAPI void* $ctor(
169 ::ActorDefinitionGroup* definitions,
170 ::ActorDefinitionIdentifier const& definitionName,
171 ::EntityContext& entityContext
172 );
173 // NOLINTEND
174
175public:
176 // virtual function thunks
177 // NOLINTBEGIN
178 MCAPI ::mce::Color $getNameTagTextColor() const;
179
180 MCFOLD bool $canShowNameTag() const;
181
182 MCFOLD bool $canBePulledIntoVehicle() const;
183
184 MCFOLD bool $canBeAffected(uint id) const;
185
186 MCFOLD void $knockback(::Actor*, int, float, float, ::KnockbackParameters const&);
187
188 MCAPI void $handleEntityEvent(::ActorEvent id, int data);
189
190 MCAPI void $initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params);
191
192 MCAPI bool $createAIGoals();
193
194 MCAPI void $setCarriedItem(::ItemStack const& item);
195
196 MCAPI void $normalTick();
197
198 MCAPI void $baseTick();
199
200 MCAPI void $teleportTo(::Vec3 const& pos, bool shouldStopRiding, int cause, int entityType, bool keepVelocity);
201
202 MCFOLD bool $canExistWhenDisallowMob() const;
203
204 MCFOLD bool $isTargetable() const;
205
206 MCAPI bool $isInvisible() const;
207
208 MCAPI void $kill();
209
210 MCAPI void $setOwner(::ActorUniqueID const id);
211
212 MCAPI ::ActorHurtResult $_hurt(::ActorDamageSource const& source, float damage, bool knock, bool ignite);
213
214 MCAPI ::std::unique_ptr<::BodyControl> $initBodyControl();
215
216
217 // NOLINTEND
218
219public:
220 // vftables
221 // NOLINTBEGIN
222 MCAPI static void** $vftable();
223 // NOLINTEND
224};
Definition AABB.h:18
Definition ActorDamageSource.h:18
Definition ActorDefinitionGroup.h:37
Definition ActorHurtResult.h:5
Definition Actor.h:125
Definition BodyControl.h:13
Definition EntityContext.h:17
Definition ItemStack.h:35
Definition Player.h:137
Definition Vec2.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition ActorDefinitionIdentifier.h:15
Definition ActorUniqueID.h:10
Definition KnockbackParameters.h:5
Definition VariantParameterList.h:14