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 // 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
81 FoodItemComponentLegacy& operator=(FoodItemComponentLegacy const&);
82 FoodItemComponentLegacy(FoodItemComponentLegacy const&);
83 FoodItemComponentLegacy();
84
85public:
86 // virtual functions
87 // NOLINTBEGIN
88 virtual int getNutrition() const /*override*/;
89
90 virtual float getSaturationModifier() const /*override*/;
91
92 virtual bool canAlwaysEat() const /*override*/;
93
94 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
95
96 virtual void use(bool& result, ::ItemStack& instance, ::Player& player) /*override*/;
97
98 virtual ::Item const* useTimeDepleted(
99 ::ItemUseMethod& itemUseMethod,
100 ::ItemStack const&,
101 ::ItemStack& instance,
102 ::Player& player,
103 ::Level& level
104 ) /*override*/;
105
106 virtual ~FoodItemComponentLegacy() /*override*/;
107 // NOLINTEND
108
109public:
110 // member functions
111 // NOLINTBEGIN
112 MCAPI void _applyEatEffects(::ItemStack const&, ::Actor& actor, ::Level& level);
113
114 MCAPI void _loadEffects(::Json::Value const& effectsData);
115
116 MCAPI void _loadRemoveEffects(::Json::Value const& removeEffectsData);
117
118 MCAPI ::std::unique_ptr<::CompoundTag> buildNetworkTag() const;
119
120 MCAPI bool init(::Json::Value const& data, ::MolangVersion);
121 // NOLINTEND
122
123public:
124 // static functions
125 // NOLINTBEGIN
126 MCAPI static ::Json::Value initializeFromNetwork(::CompoundTag const& tag);
127 // NOLINTEND
128
129public:
130 // destructor thunk
131 // NOLINTBEGIN
132 MCAPI void $dtor();
133 // NOLINTEND
134
135public:
136 // virtual function thunks
137 // NOLINTBEGIN
138 MCFOLD int $getNutrition() const;
139
140 MCFOLD float $getSaturationModifier() const;
141
142 MCAPI bool $canAlwaysEat() const;
143
144 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
145
146 MCAPI void $use(bool& result, ::ItemStack& instance, ::Player& player);
147
148 MCAPI ::Item const* $useTimeDepleted(
149 ::ItemUseMethod& itemUseMethod,
150 ::ItemStack const&,
151 ::ItemStack& instance,
152 ::Player& player,
153 ::Level& level
154 );
155
156
157 // NOLINTEND
158
159public:
160 // vftables
161 // NOLINTBEGIN
162 MCAPI static void** $vftable();
163 // NOLINTEND
164};
Definition Actor.h:105
Definition CompoundTag.h:23
Definition IFoodItemComponent.h:17
Definition ItemStack.h:26
Definition Item.h:69
Definition Value.h:16
Definition Level.h:249
Definition Player.h:125
STL namespace.
Definition FoodItemComponentLegacy.h:38