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