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