LeviLamina
Loading...
Searching...
No Matches
ProjectileComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/comprehensive/ParticleType.h"
7#include "mc/deps/core/math/Vec3.h"
8#include "mc/deps/shared_types/legacy/Difficulty.h"
9#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
10#include "mc/legacy/ActorUniqueID.h"
11#include "mc/world/actor/ActorDefinitionTrigger.h"
12#include "mc/world/actor/ActorType.h"
13#include "mc/world/actor/TempEPtr.h"
14#include "mc/world/actor/projectile/ProjectileAnchor.h"
15#include "mc/world/level/BlockPos.h"
16#include "mc/world/phys/HitResult.h"
17
18// auto generated forward declare list
19// clang-format off
20class Actor;
22class BaseGameVersion;
23class CompoundTag;
24class DataLoadHelper;
25class EntityContext;
26class Level;
28class Vec2;
29// clang-format on
30
31class ProjectileComponent {
32public:
33 // ProjectileComponent inner types define
34 enum class EAxis : int {
35 None = -1,
36 X = 0,
37 Y = 1,
38 Z = 2,
39 };
40
41public:
42 // member variables
43 // NOLINTBEGIN
44 ::ll::TypedStorage<1, 1, bool> mWasOnGround;
45 ::ll::TypedStorage<1, 1, bool> mNoPhysics;
46 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mOwnerId;
47 ::ll::TypedStorage<4, 12, ::Vec3> mThrownPos;
48 ::ll::TypedStorage<4, 12, ::Vec3> mApexPos;
49 ::ll::TypedStorage<1, 1, bool> mFoundApex;
50 ::ll::TypedStorage<4, 4, int> mDespawnTimer;
51 ::ll::TypedStorage<4, 4, int> mLifetime;
52 ::ll::TypedStorage<4, 4, int> mFlightTime;
53 ::ll::TypedStorage<4, 4, int> mOnGroundTime;
54 ::ll::TypedStorage<4, 4, int> mShakeTime;
55 ::ll::TypedStorage<4, 12, ::BlockPos> mBlock;
56 ::ll::TypedStorage<4, 12, ::BlockPos> mStuckToBlockPos;
57 ::ll::TypedStorage<4, 12, ::Vec3> mCollisionPos;
58 ::ll::TypedStorage<4, 4, int> mEnchantPower;
59 ::ll::TypedStorage<4, 4, int> mEnchantImpaler;
60 ::ll::TypedStorage<8, 136, ::HitResult> mHitResult;
61 ::ll::TypedStorage<1, 1, uchar> mHitFacing;
62 ::ll::TypedStorage<1, 1, bool> mReflect;
63 ::ll::TypedStorage<4, 4, int> mReflectImmunityTicks;
64 ::ll::TypedStorage<4, 4, float> mPower;
65 ::ll::TypedStorage<4, 4, float> mDamage;
66 ::ll::TypedStorage<4, 12, ::Vec3> mOffset;
67 ::ll::TypedStorage<4, 4, ::ParticleType> mHitParticle;
68 ::ll::TypedStorage<4, 4, float> mGravity;
69 ::ll::TypedStorage<4, 4, float> mUpwardsAngleOffset;
70 ::ll::TypedStorage<8, 24, ::std::vector<::OnHitSubcomponent*>> mOnHitCommands;
71 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnHitEvent;
72 ::ll::TypedStorage<4, 4, float> mUncertaintyBase;
73 ::ll::TypedStorage<4, 4, float> mUncertaintyMultiplier;
74 ::ll::TypedStorage<4, 4, ::ActorType> mFilterType;
75 ::ll::TypedStorage<4, 4, float> mOnFireTime;
76 ::ll::TypedStorage<4, 4, int> mPotionEffect;
77 ::ll::TypedStorage<4, 4, float> mSplashRange;
78 ::ll::TypedStorage<1, 1, bool> mKnockback;
79 ::ll::TypedStorage<4, 4, float> mKnockbackForce;
80 ::ll::TypedStorage<1, 1, bool> mCatchFire;
81 ::ll::TypedStorage<1, 1, bool> mChanneling;
82 ::ll::TypedStorage<1, 1, bool> mIsSplash;
83 ::ll::TypedStorage<4, 4, float> mInertiaMod;
84 ::ll::TypedStorage<4, 4, float> mLiquidInertia;
85 ::ll::TypedStorage<1, 1, bool> mSemiRandomDiffDamage;
86 ::ll::TypedStorage<4, 4, ::ProjectileAnchor> mSpawnPosAnchor;
87 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mHitEntitySound;
88 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mHitGroundSound;
89 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::LevelSoundEvent> mShootSound;
90 ::ll::TypedStorage<1, 1, bool> mIsDangerous;
91 ::ll::TypedStorage<1, 1, bool> mShootTarget;
92 ::ll::TypedStorage<1, 1, bool> mDamageOwner;
93 ::ll::TypedStorage<1, 1, bool> mReflectOnHurt;
94 ::ll::TypedStorage<1, 1, bool> mDestroyOnHurt;
95 ::ll::TypedStorage<1, 1, bool> mStopOnHurt;
96 ::ll::TypedStorage<1, 1, bool> mCritParticleOnHurt;
97 ::ll::TypedStorage<1, 1, bool> mHitWater;
98 ::ll::TypedStorage<1, 1, bool> mHitActor;
99 ::ll::TypedStorage<1, 1, bool> mMultipleHits;
100 ::ll::TypedStorage<4, 4, int> mPiercingEnchantLevel;
101 ::ll::TypedStorage<4, 4, int> mActorHitCount;
102 ::ll::TypedStorage<8, 24, ::std::vector<::ActorType>> mIgnoredEntities;
103 ::ll::TypedStorage<1, 1, bool> mHitNearestPassenger;
104 ::ll::TypedStorage<1, 1, bool> mIsHoming;
105 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingTargetID;
106 ::ll::TypedStorage<8, 40, ::TempEPtr<::Actor>> mTarget;
107 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mTargetID;
108 ::ll::TypedStorage<4, 12, ::Vec3> mTargetDelta;
109 ::ll::TypedStorage<4, 4, int> mFlightSteps;
110 ::ll::TypedStorage<4, 4, ::ProjectileComponent::EAxis> mCurrentMoveDirection;
111 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mLastReflectActor;
112 ::ll::TypedStorage<1, 1, bool> mShouldBounce;
113 ::ll::TypedStorage<4, 4, uint> mCurrentDelay;
114 ::ll::TypedStorage<1, 1, bool> mWaitingForServer;
115 ::ll::TypedStorage<1, 1, bool> mWaitingForServerHitGround;
116 ::ll::TypedStorage<8, 136, ::HitResult> mCachedHitResult;
117 ::ll::TypedStorage<1, 1, bool> mDelayOneFrame;
118 ::ll::TypedStorage<1, 1, bool> mShouldRestoreUsesMobTravelComponent;
119 ::ll::TypedStorage<1, 1, bool> mIsolatedPhysics;
120 // NOLINTEND
121
122public:
123 // prevent constructor by default
124 ProjectileComponent& operator=(ProjectileComponent const&);
125
126public:
127 // member functions
128 // NOLINTBEGIN
129 MCAPI ProjectileComponent();
130
131 MCAPI ProjectileComponent(::ProjectileComponent&&);
132
133 MCAPI ProjectileComponent(::ProjectileComponent const&);
134
135 MCAPI ::std::tuple<::BlockPos, float>
136 _getInitialTargetParams(::Actor const& owner, ::TempEPtr<::Actor> target) const;
137
138 MCAPI void _handleLightningOnHit(::Actor& owner);
139
140 MCAPI bool _isLoyaltyTrident(::Actor const& owner) const;
141
142 MCAPI void _selectNextMoveDirection(::Actor const& owner, ::ProjectileComponent::EAxis avoidAxis);
143
144 MCAPI bool _tryReflect(::Actor& owner, ::Level& level);
145
146 MCAPI void _tryReflectOnHurt(::Actor& owner, ::ActorDamageSource const& damageSource);
147
148 MCAPI void addAdditionalSaveData(::CompoundTag& tag) const;
149
150 MCAPI float computeCollisionMargin(::BaseGameVersion const& baseGameVersion);
151
152 MCFOLD ::ProjectileAnchor getAnchor();
153
154 MCAPI bool getCatchFire() const;
155
156 MCFOLD bool getEnchantChanneling() const;
157
158 MCAPI float getGravity() const;
159
160 MCFOLD bool getIsDangerous();
161
162 MCAPI float getKnockbackForce() const;
163
164 MCFOLD bool getNoPhysics() const;
165
166 MCAPI ::Vec3 getOffset();
167
168 MCFOLD ::SharedTypes::Legacy::LevelSoundEvent getShootSound();
169
170 MCAPI bool getShootTarget();
171
172 MCAPI ::Vec3 getShooterAngle(::Actor& shooter) const;
173
174 MCFOLD bool getShouldBounce() const;
175
176 MCAPI bool getStopOnHurt() const;
177
178 MCAPI float getThrowPower() const;
179
180 MCAPI float getUncertainty(::SharedTypes::Legacy::Difficulty diff) const;
181
182 MCAPI float getUncertaintyBase() const;
183
184 MCAPI void handleMovementGravity(::Actor& owner);
185
186 MCAPI void handleMovementHoming(::Actor& owner);
187
188 MCAPI void hurt(::Actor& owner, ::ActorDamageSource const& damageSource);
189
190 MCAPI int incrementDespawnTimer();
191
192 MCAPI int incrementFlightTime();
193
194 MCAPI int incrementLifetime();
195
196 MCAPI int incrementOnGroundTime();
197
198 MCAPI void initFromDefinition(::Actor& owner);
199
200 MCAPI void lerpMotion(::Actor& owner, ::Vec3 const& delta);
201
202 MCAPI void onComponentRemoved(::EntityContext& entity);
203
204 MCAPI void onHit(::Actor& owner, ::HitResult const& hitResult);
205
206 MCAPI ::ProjectileComponent& operator=(::ProjectileComponent&&);
207
208 MCAPI void readAdditionalSaveData(::Actor&, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
209
210 MCAPI void setActiveTarget(::Actor const& owner, ::Actor* target);
211
212 MCAPI void setCatchFire(bool catchFire);
213
214 MCAPI void setChanneling(bool channeling);
215
216 MCAPI void setEnchantImpaler(int const& level);
217
218 MCAPI void setGravity(float gravity);
219
220 MCAPI void setHitSound(::SharedTypes::Legacy::LevelSoundEvent hitSound);
221
222 MCAPI void setKnockbackForce(float force);
223
224 MCFOLD void setNoPhysics(bool value);
225
226 MCFOLD void setOwnerId(::ActorUniqueID id);
227
228 MCAPI void setPotionEffect(int potionEffect);
229
230 MCFOLD void setShouldBounce(bool bounce);
231
232 MCAPI void setSplashRange(float range);
233
234 MCAPI void setStopOnHurt(bool stopOnHurt);
235
236 MCAPI void shoot(::Actor& owner, ::Actor& shooter);
237
238 MCAPI void
239 shoot(::Actor& owner, ::Vec3 const& dir, float pow, float uncertainty, ::Vec3 const& baseSpeed, ::Actor* target);
240
241 MCAPI void tryApplyOffset(::Actor& owner, ::Actor* sender) const;
242
243 MCAPI ~ProjectileComponent();
244 // NOLINTEND
245
246public:
247 // static functions
248 // NOLINTBEGIN
249 MCAPI static ::Vec2 dampenShooterAngle(::Vec2 const& angle, float angleOffset, ::BaseGameVersion const& currVer);
250 // NOLINTEND
251
252public:
253 // constructor thunks
254 // NOLINTBEGIN
255 MCAPI void* $ctor();
256
257 MCAPI void* $ctor(::ProjectileComponent&&);
258
259 MCAPI void* $ctor(::ProjectileComponent const&);
260 // NOLINTEND
261
262public:
263 // destructor thunk
264 // NOLINTBEGIN
265 MCAPI void $dtor();
266 // NOLINTEND
267};
Definition ActorDamageSource.h:18
Definition Actor.h:125
Definition BaseGameVersion.h:13
Definition CompoundTag.h:23
Definition DataLoadHelper.h:20
Definition EntityContext.h:17
Definition HitResult.h:19
Definition Level.h:255
Definition OnHitSubcomponent.h:12
Definition TempEPtr.h:6
Definition Vec2.h:5
Definition Vec3.h:10
Definition ActorUniqueID.h:10