Skip to content
LeviMC
English
AutoLightDark
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/LevelSoundEvent.h"
9#include "mc/deps/shared_types/v1_26_50/actor/ProjectileComponentDefinition.h"
10#include "mc/entity/components_json_legacy/ProjectileHitState.h"
11#include "mc/legacy/ActorUniqueID.h"
12#include "mc/world/actor/ActorDefinitionTrigger.h"
13#include "mc/world/actor/ActorType.h"
14#include "mc/world/actor/TempEPtr.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;
27class Vec2;
28// clang-format on
29
31public:
32 // ProjectileComponent inner types define
33 enum class EAxis : int {
34 None = -1,
35 X = 0,
36 Y = 1,
37 Z = 2,
38 };
39
40 using ProjectileAnchor = ::SharedTypes::v1_26_50::ProjectileComponentDefinition::ProjectileAnchor;
41
42 using ShouldBounce = ::SharedTypes::v1_26_50::ProjectileComponentDefinition::ShouldBounce;
43
44public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<1, 1, bool> mWasOnGround;
48 ::ll::TypedStorage<1, 1, bool> mNoPhysics;
49 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mOwnerId;
50 ::ll::TypedStorage<4, 12, ::Vec3> mThrownPos;
51 ::ll::TypedStorage<4, 12, ::Vec3> mApexPos;
52 ::ll::TypedStorage<1, 1, bool> mFoundApex;
53 ::ll::TypedStorage<4, 4, int> mDespawnTimer;
54 ::ll::TypedStorage<4, 4, int> mLifetime;
55 ::ll::TypedStorage<4, 4, int> mFlightTime;
56 ::ll::TypedStorage<4, 4, int> mOnGroundTime;
57 ::ll::TypedStorage<4, 4, int> mShakeTime;
58 ::ll::TypedStorage<4, 12, ::BlockPos> mBlock;
59 ::ll::TypedStorage<4, 12, ::BlockPos> mStuckToBlockPos;
60 ::ll::TypedStorage<4, 12, ::Vec3> mCollisionPos;
61 ::ll::TypedStorage<4, 4, int> mEnchantPower;
62 ::ll::TypedStorage<4, 4, int> mEnchantImpaler;
63 ::ll::TypedStorage<8, 136, ::HitResult> mHitResult;
64 ::ll::TypedStorage<1, 1, uchar> mHitFacing;
65 ::ll::TypedStorage<1, 1, bool> mReflect;
66 ::ll::TypedStorage<4, 4, int> mReflectImmunityTicks;
67 ::ll::TypedStorage<4, 4, float> mPower;
68 ::ll::TypedStorage<4, 4, float> mDamage;
69 ::ll::TypedStorage<4, 12, ::Vec3> mOffset;
70 ::ll::TypedStorage<4, 4, ::ParticleType> mHitParticle;
71 ::ll::TypedStorage<4, 4, float> mGravity;
72 ::ll::TypedStorage<4, 4, float> mUpwardsAngleOffset;
73 ::ll::TypedStorage<8, 24, ::std::vector<::OnHitSubcomponent*>> mOnHitCommands;
74 ::ll::TypedStorage<8, 104, ::ActorDefinitionTrigger> mOnHitEvent;
75 ::ll::TypedStorage<4, 4, float> mUncertaintyBase;
76 ::ll::TypedStorage<4, 4, float> mUncertaintyMultiplier;
77 ::ll::TypedStorage<4, 4, float> mOnFireTime;
78 ::ll::TypedStorage<4, 4, int> mPotionEffect;
79 ::ll::TypedStorage<4, 4, float> mSplashRange;
80 ::ll::TypedStorage<4, 4, float> mKnockbackForce;
81 ::ll::TypedStorage<1, 1, bool> mCatchFire;
82 ::ll::TypedStorage<1, 1, bool> mSpreadFire;
83 ::ll::TypedStorage<1, 1, bool> mChanneling;
84 ::ll::TypedStorage<4, 4, float> mInertiaMod;
85 ::ll::TypedStorage<4, 4, float> mLiquidInertia;
86 ::ll::TypedStorage<1, 1, ::SharedTypes::v1_26_50::ProjectileComponentDefinition::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, 5, ::ProjectileHitState> mHitState;
113 ::ll::TypedStorage<1, 1, ::SharedTypes::v1_26_50::ProjectileComponentDefinition::ShouldBounce> mShouldBounce;
114 ::ll::TypedStorage<1, 1, bool> mHasLeftOwner;
115 ::ll::TypedStorage<4, 4, uint> mCurrentDelay;
116 ::ll::TypedStorage<1, 1, bool> mWaitingForServer;
117 ::ll::TypedStorage<1, 1, bool> mWaitingForServerHitGround;
118 ::ll::TypedStorage<8, 136, ::HitResult> mCachedHitResult;
119 ::ll::TypedStorage<1, 1, bool> mDelayOneFrame;
120 ::ll::TypedStorage<1, 1, bool> mShouldRestoreUsesMobTravelComponent;
121 ::ll::TypedStorage<1, 1, bool> mIsolatedPhysics;
122 // NOLINTEND
123
124public:
125 // prevent constructor by default
126 ProjectileComponent& operator=(ProjectileComponent const&);
127
128public:
129 // member functions
130 // NOLINTBEGIN
132
134
136
137 MCNAPI void _selectNextMoveDirection(::Actor const& owner, ::ProjectileComponent::EAxis avoidAxis);
138
139 MCNAPI void _tryReflectOnHurt(::Actor& owner, ::ActorDamageSource const& damageSource);
140
141 MCNAPI void addAdditionalSaveData(::CompoundTag& tag) const;
142
143 MCNAPI ::std::vector<::ActorType> const getIgnoredEntities() const;
144
145 MCNAPI ::Vec3 getShooterAngle(::Actor& shooter) const;
146
147 MCAPI void handleMovementAndGravity(::Actor& owner, bool skipPositionUpdate);
148
149 MCAPI void handleMovementHoming(::Actor& owner);
150
151 MCNAPI void hurt(::Actor& owner, ::ActorDamageSource const& damageSource);
152
153 MCNAPI void initFromDefinition(::Actor& owner);
154
155 MCNAPI void lerpMotion(::Actor& owner, ::Vec3 const& delta);
156
158
159 MCAPI void onHit(::Actor& owner, ::HitResult const& hitResult);
160
161 MCNAPI ::ProjectileComponent& operator=(::ProjectileComponent&&);
162
163 MCNAPI void readAdditionalSaveData(::Actor&, ::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
164
165 MCNAPI void setActiveTarget(::Actor const& owner, ::Actor* target);
166
167 MCNAPI void shoot(::Actor& owner, ::Actor& shooter);
168
169 MCAPI void
170 shoot(::Actor& owner, ::Vec3 const& dir, float pow, float uncertainty, ::Vec3 const& baseSpeed, ::Actor* target);
171
172 MCNAPI void tryApplyOffset(::Actor& owner, ::Actor* sender) const;
173
175 // NOLINTEND
176
177public:
178 // static functions
179 // NOLINTBEGIN
180 MCNAPI static bool _isLoyaltyTrident(::Actor const& owner);
181
182 MCNAPI static ::Vec2 dampenShooterAngle(::Vec2 const& angle, float angleOffset, ::BaseGameVersion const& version);
183 // NOLINTEND
184
185public:
186 // constructor thunks
187 // NOLINTBEGIN
188 MCNAPI void* $ctor();
189
191
192 MCNAPI void* $ctor(::ProjectileComponent const&);
193 // NOLINTEND
194
195public:
196 // destructor thunk
197 // NOLINTBEGIN
198 MCNAPI void $dtor();
199 // NOLINTEND
200};
Definition ActorDamageSource.h:18
Definition Actor.h:116
Definition BaseGameVersion.h:8
Definition CompoundTag.h:18
Definition DataLoadHelper.h:20
Definition EntityContext.h:15
Definition HitResult.h:18
Definition OnHitSubcomponent.h:13
MCAPI::ProjectileComponent & operator=(::ProjectileComponent &&)
MCAPI void * $ctor(::ProjectileComponent const &)
static MCAPI ::Vec2 dampenShooterAngle(::Vec2 const &angle, float angleOffset, ::BaseGameVersion const &version)
static MCAPI bool _isLoyaltyTrident(::Actor const &owner)
MCAPI void initFromDefinition(::Actor &owner)
MCAPI ProjectileComponent(::ProjectileComponent const &)
MCAPI void $dtor()
MCAPI ProjectileComponent()
MCAPI void lerpMotion(::Actor &owner, ::Vec3 const &delta)
MCAPI void _selectNextMoveDirection(::Actor const &owner, ::ProjectileComponent::EAxis avoidAxis)
MCAPI ::std::vector<::ActorType > const getIgnoredEntities() const
MCAPI ProjectileComponent(::ProjectileComponent &&)
MCAPI void shoot(::Actor &owner, ::Actor &shooter)
MCAPI void setActiveTarget(::Actor const &owner, ::Actor *target)
MCAPI void * $ctor()
MCAPI void hurt(::Actor &owner, ::ActorDamageSource const &damageSource)
MCAPI void readAdditionalSaveData(::Actor &, ::CompoundTag const &tag, ::DataLoadHelper &dataLoadHelper)
MCAPI void addAdditionalSaveData(::CompoundTag &tag) const
MCAPI void tryApplyOffset(::Actor &owner, ::Actor *sender) const
MCAPI::Vec3 getShooterAngle(::Actor &shooter) const
MCAPI void _tryReflectOnHurt(::Actor &owner, ::ActorDamageSource const &damageSource)
MCAPI void * $ctor(::ProjectileComponent &&)
MCAPI ~ProjectileComponent()
MCAPI void onComponentRemoved(::EntityContext &entity)
Definition Vec2.h:5
Definition Vec3.h:10