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
24class FoodItemComponentLegacy : public ::IFoodItemComponent {
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 // prevent constructor by default
52 Effect& operator=(Effect const&);
53 Effect();
54
55 public:
56 // member functions
57 // NOLINTBEGIN
58 MCAPI Effect(::FoodItemComponentLegacy::Effect const&);
59
60 MCAPI ~Effect();
61 // NOLINTEND
62
63 public:
64 // constructor thunks
65 // NOLINTBEGIN
66 MCAPI void* $ctor(::FoodItemComponentLegacy::Effect const&);
67 // NOLINTEND
68
69 public:
70 // destructor thunk
71 // NOLINTBEGIN
72 MCFOLD void $dtor();
73 // NOLINTEND
74 };
75
76public:
77 // member variables
78 // NOLINTBEGIN
79 ::ll::TypedStorage<8, 8, ::Item&> mOwner;
80 ::ll::TypedStorage<4, 4, int> mNutrition;
81 ::ll::TypedStorage<4, 4, float> mSaturationModifier;
82 ::ll::TypedStorage<8, 32, ::std::string> mUsingConvertsTo;
83 ::ll::TypedStorage<4, 4, ::FoodItemComponentLegacy::OnUseAction> mOnUseAction;
84 ::ll::TypedStorage<4, 12, ::Vec3> mOnUseRange;
85 ::ll::TypedStorage<8, 48, ::HashedString> mCooldownCategory;
86 ::ll::TypedStorage<4, 4, int> mCooldownDuration;
87 ::ll::TypedStorage<1, 1, bool> mCanAlwaysEat;
88 ::ll::TypedStorage<8, 24, ::std::vector<::FoodItemComponentLegacy::Effect>> mEffects;
89 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mRemoveEffects;
90 // NOLINTEND
91
92public:
93 // prevent constructor by default
94 FoodItemComponentLegacy& operator=(FoodItemComponentLegacy const&);
95 FoodItemComponentLegacy(FoodItemComponentLegacy const&);
96 FoodItemComponentLegacy();
97
98public:
99 // virtual functions
100 // NOLINTBEGIN
101 virtual int getNutrition() const /*override*/;
102
103 virtual float getSaturationModifier() const /*override*/;
104
105 virtual bool canAlwaysEat() const /*override*/;
106
107 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
108
109 virtual void use(bool& result, ::ItemStack& instance, ::Player& player) /*override*/;
110
111 virtual ::Item const* useTimeDepleted(
112 ::ItemUseMethod& itemUseMethod,
113 ::ItemStack const& instance,
114 ::ItemStack& player,
115 ::Player& level,
116 ::Level&
117 ) /*override*/;
118 // NOLINTEND
119
120public:
121 // member functions
122 // NOLINTBEGIN
123 MCAPI explicit FoodItemComponentLegacy(::Item& owner);
124
125 MCAPI void _applyEatEffects(::ItemStack const& actor, ::Actor& level, ::Level&);
126
127 MCAPI void _loadEffects(::Json::Value const& effectsData);
128
129 MCAPI void _loadRemoveEffects(::Json::Value const& removeEffectsData);
130
131 MCAPI ::std::unique_ptr<::CompoundTag> buildNetworkTag() const;
132
133 MCAPI bool init(::Json::Value const& data, ::MolangVersion);
134 // NOLINTEND
135
136public:
137 // static functions
138 // NOLINTBEGIN
139 MCAPI static ::Json::Value initializeFromNetwork(::CompoundTag const& tag);
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor(::Item& owner);
146 // NOLINTEND
147
148public:
149 // virtual function thunks
150 // NOLINTBEGIN
151 MCFOLD int $getNutrition() const;
152
153 MCFOLD float $getSaturationModifier() const;
154
155 MCFOLD bool $canAlwaysEat() const;
156
157 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
158
159 MCAPI void $use(bool& result, ::ItemStack& instance, ::Player& player);
160
161 MCAPI ::Item const* $useTimeDepleted(
162 ::ItemUseMethod& itemUseMethod,
163 ::ItemStack const& instance,
164 ::ItemStack& player,
165 ::Player& level,
166 ::Level&
167 );
168
169
170 // NOLINTEND
171
172public:
173 // vftables
174 // NOLINTBEGIN
175 MCAPI static void** $vftable();
176 // NOLINTEND
177};
Definition Actor.h:125
Definition CompoundTag.h:23
Definition IFoodItemComponent.h:17
Definition ItemStack.h:35
Definition Item.h:71
Definition Value.h:16
Definition Level.h:255
Definition Player.h:137
STL namespace.
Definition FoodItemComponentLegacy.h:38