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 HashedString;
19class Item;
20class ItemStack;
21class Level;
22class Player;
23class SemVersion;
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 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 // prevent constructor by default
56
57public:
58 // virtual functions
59 // NOLINTBEGIN
60 // vIndex: 0
61 virtual ~FoodItemComponent() /*override*/ = default;
62
63 // vIndex: 7
64 virtual void _initializeComponent() /*override*/;
65
66 // vIndex: 1
67 virtual int getNutrition() const /*override*/;
68
69 // vIndex: 2
70 virtual float getSaturationModifier() const /*override*/;
71
72 // vIndex: 3
73 virtual bool canAlwaysEat() const /*override*/;
74
75 // vIndex: 4
76 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
77
78 // vIndex: 5
79 virtual void use(bool& result, ::ItemStack& item, ::Player& player) /*override*/;
80
81 // vIndex: 6
82 virtual ::Item const*
83 useTimeDepleted(::ItemUseMethod&, ::ItemStack const&, ::ItemStack&, ::Player&, ::Level&) /*override*/;
84 // NOLINTEND
85
86public:
87 // member functions
88 // NOLINTBEGIN
90
91 MCAPI ::Bedrock::PubSub::Connector<void(::ItemStack const&, ::ItemStack&, ::Actor&)>& onConsume();
92 // NOLINTEND
93
94public:
95 // static functions
96 // NOLINTBEGIN
97 MCAPI static void bindType(
99 ::std::vector<::AllExperiments> const& requiredToggles,
100 ::std::optional<::SemVersion> releasedMinFormatVersion
101 );
102
103 MCAPI static ::HashedString const& getIdentifier();
104 // NOLINTEND
105
106public:
107 // constructor thunks
108 // NOLINTBEGIN
109 MCAPI void* $ctor(::SharedTypes::v1_20_50::FoodItemComponent component);
110 // NOLINTEND
111
112public:
113 // virtual function thunks
114 // NOLINTBEGIN
115 MCAPI void $_initializeComponent();
116
117 MCFOLD int $getNutrition() const;
118
119 MCFOLD float $getSaturationModifier() const;
120
121 MCFOLD bool $canAlwaysEat() const;
122
123 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
124
125 MCAPI void $use(bool& result, ::ItemStack& item, ::Player& player);
126 // NOLINTEND
127
128public:
129 // vftables
130 // NOLINTBEGIN
131 MCNAPI static void** $vftableForNetworkedItemComponent();
132
133 MCNAPI static void** $vftableForIFoodItemComponent();
134 // NOLINTEND
135};
Definition Actor.h:103
Definition Publisher.h:8
Definition FoodItemComponent.h:29
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:239
Definition NetworkedItemComponent.h:7
Definition Player.h:120
Definition SemVersion.h:16
Definition FoodItemComponent.h:12
Definition ReflectionCtx.h:11
Definition ctx.h:5