LeviLamina
Loading...
Searching...
No Matches
FoodItemComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/pub_sub/Connector.h"
7#include "mc/deps/core/utility/pub_sub/Publisher.h"
8#include "mc/deps/core/utility/pub_sub/Subscription.h"
9#include "mc/world/item/ItemDescriptor.h"
10#include "mc/world/item/ItemUseMethod.h"
11#include "mc/world/item/components/IFoodItemComponent.h"
12#include "mc/world/item/components/NetworkedItemComponent.h"
13#include "mc/world/level/storage/AllExperiments.h"
14
15// auto generated forward declare list
16// clang-format off
17class Actor;
19class ComponentItem;
20class HashedString;
21class Item;
22class ItemStack;
23class Level;
24class Player;
25class SemVersion;
26namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
27namespace SharedTypes::v1_20_50 { struct FoodItemComponent; }
28namespace cereal { struct ReflectionCtx; }
29// clang-format on
30
31class FoodItemComponent : public ::NetworkedItemComponent<::FoodItemComponent>, public ::IFoodItemComponent {
32public:
33 // FoodItemComponent inner types define
34 using ConsumeSignature = void(::ItemStack const&, ::ItemStack&, ::Actor&);
35
36public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<4, 4, int> mNutrition;
40 ::ll::TypedStorage<4, 4, float> mSaturationModifier;
41 ::ll::TypedStorage<8, 16, ::ItemDescriptor> mUsingConvertsTo;
42 ::ll::TypedStorage<1, 1, bool> mCanAlwaysEat;
43 ::ll::TypedStorage<
44 8,
45 8,
46 ::std::unique_ptr<::Bedrock::PubSub::Publisher<
47 void(::ItemStack const&, ::ItemStack&, ::Actor&),
49 0>>>
50 mOnConsumePublisher;
51 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseTimeDepletedSubscription;
52 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseSubscription;
53 // NOLINTEND
54
55public:
56 // virtual functions
57 // NOLINTBEGIN
58 virtual ~FoodItemComponent() /*override*/;
59
60 virtual void _initializeComponent(::ComponentItem& owner) /*override*/;
61
62 virtual int getNutrition() const /*override*/;
63
64 virtual float getSaturationModifier() const /*override*/;
65
66 virtual bool canAlwaysEat() const /*override*/;
67
68 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
69
70 virtual void use(bool& result, ::ItemStack& instance, ::Player& player) /*override*/;
71
72 virtual ::Item const* useTimeDepleted(
73 ::ItemUseMethod& itemUseMethod,
74 ::ItemStack const& initialInstance,
75 ::ItemStack& instance,
76 ::Player& player,
77 ::Level& level
78 ) /*override*/;
79 // NOLINTEND
80
81public:
82 // member functions
83 // NOLINTBEGIN
84 MCAPI FoodItemComponent();
85
86 MCAPI explicit FoodItemComponent(::SharedTypes::v1_20_50::FoodItemComponent component);
87
88 MCAPI ::ItemDescriptor getUsingConvertsToItemDescriptor() const;
89
90 MCAPI ::Bedrock::PubSub::Connector<void(::ItemStack const&, ::ItemStack&, ::Actor&)>& onConsume();
91 // NOLINTEND
92
93public:
94 // static functions
95 // NOLINTBEGIN
96 MCAPI static void bindType(
98 ::std::vector<::AllExperiments> const& requiredToggles,
99 ::std::optional<::SemVersion> releasedMinFormatVersion
100 );
101
102 MCAPI static ::HashedString const& getIdentifier();
103
104 MCAPI static void registerVersionUpgrades(::CerealSchemaUpgradeSet& schemaUpgrades);
105 // NOLINTEND
106
107public:
108 // constructor thunks
109 // NOLINTBEGIN
110 MCAPI void* $ctor();
111
112 MCAPI void* $ctor(::SharedTypes::v1_20_50::FoodItemComponent component);
113 // NOLINTEND
114
115public:
116 // destructor thunk
117 // NOLINTBEGIN
118 MCAPI void $dtor();
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCAPI void $_initializeComponent(::ComponentItem& owner);
125
126 MCFOLD int $getNutrition() const;
127
128 MCFOLD float $getSaturationModifier() const;
129
130 MCFOLD bool $canAlwaysEat() const;
131
132 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
133
134 MCAPI void $use(bool& result, ::ItemStack& instance, ::Player& player);
135
136 MCAPI ::Item const* $useTimeDepleted(
137 ::ItemUseMethod& itemUseMethod,
138 ::ItemStack const& initialInstance,
139 ::ItemStack& instance,
140 ::Player& player,
141 ::Level& level
142 );
143
144
145 // NOLINTEND
146
147public:
148 // vftables
149 // NOLINTBEGIN
150 MCNAPI static void** $vftableForNetworkedItemComponent();
151
152 MCNAPI static void** $vftableForIFoodItemComponent();
153 // NOLINTEND
154};
Definition Actor.h:125
Definition Publisher.h:8
Definition CerealSchemaUpgradeSet.h:10
Definition ComponentItem.h:55
static MCAPI void ** $vftableForIFoodItemComponent()
static MCAPI void ** $vftableForNetworkedItemComponent()
Definition HashedString.h:5
Definition IFoodItemComponent.h:17
Definition ItemStack.h:35
Definition Item.h:71
Definition Level.h:255
Definition NetworkedItemComponent.h:7
Definition Player.h:137
Definition SemVersion.h:15
Definition FoodItemComponent.h:15
Definition ReflectionCtx.h:11
Definition ctx.h:5