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 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 0>>>
48 mOnConsumePublisher;
49 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseTimeDepletedSubscription;
50 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnUseSubscription;
51 // NOLINTEND
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual ~FoodItemComponent() /*override*/ = default;
57
58 virtual void _initializeComponent(::ComponentItem& owner) /*override*/;
59
60 virtual int getNutrition() const /*override*/;
61
62 virtual float getSaturationModifier() const /*override*/;
63
64 virtual bool canAlwaysEat() const /*override*/;
65
66 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
67
68 virtual void use(bool& result, ::ItemStack& item, ::Player& player) /*override*/;
69
70 virtual ::Item const*
71 useTimeDepleted(::ItemUseMethod&, ::ItemStack const&, ::ItemStack&, ::Player&, ::Level&) /*override*/;
72 // NOLINTEND
73
74public:
75 // member functions
76 // NOLINTBEGIN
77 MCAPI ::Bedrock::PubSub::Connector<void(::ItemStack const&, ::ItemStack&, ::Actor&)>& onConsume();
78 // NOLINTEND
79
80public:
81 // static functions
82 // NOLINTBEGIN
83 MCAPI static void bindType(
85 ::std::vector<::AllExperiments> const& requiredToggles,
86 ::std::optional<::SemVersion> releasedMinFormatVersion
87 );
88
89 MCAPI static ::HashedString const& getIdentifier();
90 // NOLINTEND
91
92public:
93 // virtual function thunks
94 // NOLINTBEGIN
95 MCAPI void $_initializeComponent(::ComponentItem& owner);
96
97 MCFOLD int $getNutrition() const;
98
99 MCFOLD float $getSaturationModifier() const;
100
101 MCFOLD bool $canAlwaysEat() const;
102
103 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
104
105 MCAPI void $use(bool& result, ::ItemStack& item, ::Player& player);
106
107
108 // NOLINTEND
109
110public:
111 // vftables
112 // NOLINTBEGIN
113 MCNAPI static void** $vftableForNetworkedItemComponent();
114
115 MCNAPI static void** $vftableForIFoodItemComponent();
116 // NOLINTEND
117};
Definition Actor.h:105
Definition Publisher.h:8
Definition ComponentItem.h:55
Definition FoodItemComponent.h:29
static MCAPI void ** $vftableForIFoodItemComponent()
static MCAPI void ** $vftableForNetworkedItemComponent()
Definition HashedString.h:5
Definition IFoodItemComponent.h:17
Definition ItemStack.h:26
Definition Item.h:69
Definition Level.h:249
Definition NetworkedItemComponent.h:7
Definition Player.h:125
Definition SemVersion.h:15
Definition ReflectionCtx.h:11
Definition ctx.h:5