LeviLamina
Loading...
Searching...
No Matches
FoodItemComponentLegacy.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/math/Vec3.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/molang/MolangVersion.h"
9#include "mc/world/effect/EffectDuration.h"
10#include "mc/world/item/ItemUseMethod.h"
11#include "mc/world/item/components/IFoodItemComponent.h"
12
13// auto generated forward declare list
14// clang-format off
15class Actor;
16class CompoundTag;
17class Item;
18class ItemStack;
19class Level;
20class Player;
21namespace Json { class Value; }
22// clang-format on
23
25public:
26 // FoodItemComponentLegacy inner types declare
27 // clang-format off
28 struct Effect;
29 // clang-format on
30
31 // FoodItemComponentLegacy inner types define
32 enum class OnUseAction : int {
33 None = -1,
34 ChorusTeleport = 0,
35 SuspiciousStewEffect = 1,
36 };
37
38 struct Effect {
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<4, 4, int> id;
43 ::ll::TypedStorage<8, 32, ::std::string> name;
44 ::ll::TypedStorage<8, 32, ::std::string> descriptionId;
45 ::ll::TypedStorage<4, 4, ::EffectDuration> duration;
46 ::ll::TypedStorage<4, 4, int> amplifier;
47 ::ll::TypedStorage<4, 4, float> chance;
48 // NOLINTEND
49
50 public:
51 // member functions
52 // NOLINTBEGIN
53 MCAPI ~Effect();
54 // NOLINTEND
55
56 public:
57 // destructor thunk
58 // NOLINTBEGIN
59 MCFOLD void $dtor();
60 // NOLINTEND
61 };
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 8, ::Item&> mOwner;
67 ::ll::TypedStorage<4, 4, int> mNutrition;
68 ::ll::TypedStorage<4, 4, float> mSaturationModifier;
69 ::ll::TypedStorage<8, 32, ::std::string> mUsingConvertsTo;
70 ::ll::TypedStorage<4, 4, ::FoodItemComponentLegacy::OnUseAction> mOnUseAction;
71 ::ll::TypedStorage<4, 12, ::Vec3> mOnUseRange;
72 ::ll::TypedStorage<8, 48, ::HashedString> mCooldownCategory;
73 ::ll::TypedStorage<4, 4, int> mCooldownDuration;
74 ::ll::TypedStorage<1, 1, bool> mCanAlwaysEat;
75 ::ll::TypedStorage<8, 24, ::std::vector<::FoodItemComponentLegacy::Effect>> mEffects;
76 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mRemoveEffects;
77 // NOLINTEND
78
79public:
80 // prevent constructor by default
84
85public:
86 // virtual functions
87 // NOLINTBEGIN
88 // vIndex: 1
89 virtual int getNutrition() const /*override*/;
90
91 // vIndex: 2
92 virtual float getSaturationModifier() const /*override*/;
93
94 // vIndex: 3
95 virtual bool canAlwaysEat() const /*override*/;
96
97 // vIndex: 4
98 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
99
100 // vIndex: 5
101 virtual void use(bool& result, ::ItemStack& item, ::Player& player) /*override*/;
102
103 // vIndex: 6
104 virtual ::Item const* useTimeDepleted(
105 ::ItemUseMethod& itemUseMethod,
106 ::ItemStack const&,
107 ::ItemStack& instance,
108 ::Player& player,
109 ::Level& level
110 ) /*override*/;
111
112 // vIndex: 0
113 virtual ~FoodItemComponentLegacy() /*override*/;
114 // NOLINTEND
115
116public:
117 // member functions
118 // NOLINTBEGIN
119 MCAPI void _applyEatEffects(::ItemStack const&, ::Actor& actor, ::Level& level);
120
121 MCAPI void _loadEffects(::Json::Value const& effectsData);
122
123 MCAPI void _loadRemoveEffects(::Json::Value const& removeEffectsData);
124
125 MCAPI ::std::unique_ptr<::CompoundTag> buildNetworkTag() const;
126
127 MCAPI bool init(::Json::Value const& data, ::MolangVersion);
128 // NOLINTEND
129
130public:
131 // static functions
132 // NOLINTBEGIN
133 MCAPI static ::Json::Value initializeFromNetwork(::CompoundTag const& tag);
134 // NOLINTEND
135
136public:
137 // destructor thunk
138 // NOLINTBEGIN
139 MCAPI void $dtor();
140 // NOLINTEND
141
142public:
143 // virtual function thunks
144 // NOLINTBEGIN
145 MCFOLD int $getNutrition() const;
146
147 MCFOLD float $getSaturationModifier() const;
148
149 MCAPI bool $canAlwaysEat() const;
150
151 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
152
153 MCAPI void $use(bool& result, ::ItemStack& item, ::Player& player);
154
155 MCAPI ::Item const* $useTimeDepleted(
156 ::ItemUseMethod& itemUseMethod,
157 ::ItemStack const&,
158 ::ItemStack& instance,
159 ::Player& player,
160 ::Level& level
161 );
162 // NOLINTEND
163
164public:
165 // vftables
166 // NOLINTBEGIN
167 MCNAPI static void** $vftable();
168 // NOLINTEND
169};
Definition Actor.h:102
Definition CompoundTag.h:13
Definition FoodItemComponentLegacy.h:24
static MCAPI void ** $vftable()
Definition IFoodItemComponent.h:17
Definition ItemStack.h:23
Definition Item.h:66
Definition Level.h:243
Definition Player.h:123
STL namespace.
Definition FoodItemComponentLegacy.h:38