LeviLamina
Loading...
Searching...
No Matches
ShooterItemComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/pub_sub/Subscription.h"
7#include "mc/world/item/ItemDescriptor.h"
8#include "mc/world/item/components/NetworkedItemComponent.h"
9#include "mc/world/level/storage/AllExperiments.h"
10
11// auto generated forward declare list
12// clang-format off
13class ComponentItem;
14class HashedString;
15class ItemStack;
16class Player;
17class SemVersion;
18namespace Bedrock::PubSub { class Subscription; }
19namespace SharedTypes::v1_20_50 { struct ShooterItemComponent; }
20namespace cereal { struct ReflectionCtx; }
21// clang-format on
22
23class ShooterItemComponent : public ::NetworkedItemComponent<::ShooterItemComponent> {
24public:
25 // ShooterItemComponent inner types declare
26 // clang-format off
27 class DrawDuration;
29 // clang-format on
30
31 // ShooterItemComponent inner types define
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 16, ::ItemDescriptor> itemDesc;
37 ::ll::TypedStorage<1, 1, bool> useOffhand;
38 ::ll::TypedStorage<1, 1, bool> searchInventory;
39 ::ll::TypedStorage<1, 1, bool> useInCreative;
40 // NOLINTEND
41
42 public:
43 // prevent constructor by default
45
46 public:
47 // member functions
48 // NOLINTBEGIN
50
51 MCFOLD ::ShooterItemComponent::ShooterAmmunitionEntry&
53
55 // NOLINTEND
56
57 public:
58 // constructor thunks
59 // NOLINTBEGIN
60 MCFOLD void* $ctor(::ShooterItemComponent::ShooterAmmunitionEntry const&);
61 // NOLINTEND
62
63 public:
64 // destructor thunk
65 // NOLINTBEGIN
66 MCFOLD void $dtor();
67 // NOLINTEND
68 };
69
71 public:
72 // member variables
73 // NOLINTBEGIN
74 ::ll::TypedStorage<4, 4, float> mDuration;
75 // NOLINTEND
76
77 public:
78 // member functions
79 // NOLINTBEGIN
80 MCFOLD float getData() const;
81
82 MCAPI void setValue(float duration);
83 // NOLINTEND
84 };
85
86public:
87 // member variables
88 // NOLINTBEGIN
89 ::ll::TypedStorage<8, 24, ::std::vector<::ShooterItemComponent::ShooterAmmunitionEntry>> mAmmunition;
90 ::ll::TypedStorage<4, 4, ::ShooterItemComponent::DrawDuration> mDrawDuration;
91 ::ll::TypedStorage<1, 1, bool> mScalePowerByDrawDuration;
92 ::ll::TypedStorage<1, 1, bool> mChargeOnDraw;
93 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseTimeDepletedSubscription;
94 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseSubscription;
95 // NOLINTEND
96
97public:
98 // prevent constructor by default
100
101public:
102 // virtual functions
103 // NOLINTBEGIN
104 // vIndex: 0
105 virtual ~ShooterItemComponent() /*override*/ = default;
106
107 // vIndex: 7
108 virtual void _initializeComponent(::ComponentItem& owner) /*override*/;
109
110 // vIndex: 1
111 virtual bool checkComponentDataForContentErrors() const /*override*/;
112 // NOLINTEND
113
114public:
115 // member functions
116 // NOLINTBEGIN
117 MCAPI explicit ShooterItemComponent(::SharedTypes::v1_20_50::ShooterItemComponent const& component);
118
119 MCAPI void _consumeAmmunition(
120 ::Player* player,
121 ::ItemStack const& ammunition,
122 int slotIndex,
123 bool infiniteAmmo,
124 bool fromOffhand
125 ) const;
126
127 MCAPI int _getAmmunition(::Player const* player, bool, ::ItemStack& ammo, bool& fromOffhand) const;
128
129 MCAPI void _shootProjectiles(::ItemStack& shooterStack, ::Player* player, int durationLeft) const;
130
131 MCAPI bool releaseUsing(::ItemStack& item, ::Player* player, int durationLeft) const;
132
133 MCAPI void use(bool& result, ::ItemStack& instance, ::Player& player) const;
134 // NOLINTEND
135
136public:
137 // static functions
138 // NOLINTBEGIN
139 MCAPI static void bindType(
140 ::cereal::ReflectionCtx& ctx,
141 ::std::vector<::AllExperiments> const& requiredToggles,
142 ::std::optional<::SemVersion> releasedMinFormatVersion
143 );
144
145 MCAPI static ::HashedString const& getIdentifier();
146 // NOLINTEND
147
148public:
149 // constructor thunks
150 // NOLINTBEGIN
151 MCAPI void* $ctor(::SharedTypes::v1_20_50::ShooterItemComponent const& component);
152 // NOLINTEND
153
154public:
155 // virtual function thunks
156 // NOLINTBEGIN
157 MCAPI void $_initializeComponent(::ComponentItem& owner);
158
159 MCAPI bool $checkComponentDataForContentErrors() const;
160 // NOLINTEND
161
162public:
163 // vftables
164 // NOLINTBEGIN
165 MCNAPI static void** $vftable();
166 // NOLINTEND
167};
Definition ComponentItem.h:53
Definition HashedString.h:5
Definition ItemStack.h:23
Definition NetworkedItemComponent.h:7
Definition Player.h:123
Definition SemVersion.h:16
Definition ShooterItemComponent.h:70
Definition ShooterItemComponent.h:23
static MCAPI void ** $vftable()
STL namespace.
Definition ShooterItemComponent.h:32
Definition ctx.h:5