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