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/world/effect/EffectDuration.h"
9#include "mc/world/item/ItemUseMethod.h"
10#include "mc/world/item/components/IFoodItemComponent.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class Item;
16class ItemStack;
17class Level;
18class Player;
19struct ItemOnUseResult;
20// clang-format on
21
22class FoodItemComponentLegacy : public ::IFoodItemComponent {
23public:
24 // FoodItemComponentLegacy inner types declare
25 // clang-format off
26 struct Effect;
27 // clang-format on
28
29 // FoodItemComponentLegacy inner types define
30 enum class OnUseAction : int {
31 None = -1,
32 ChorusTeleport = 0,
33 SuspiciousStewEffect = 1,
34 };
35
36 struct Effect {
37 public:
38 // member variables
39 // NOLINTBEGIN
40 ::ll::TypedStorage<4, 4, int> id;
41 ::ll::TypedStorage<8, 32, ::std::string> name;
42 ::ll::TypedStorage<8, 32, ::std::string> descriptionId;
43 ::ll::TypedStorage<4, 4, ::EffectDuration> duration;
44 ::ll::TypedStorage<4, 4, int> amplifier;
45 ::ll::TypedStorage<4, 4, float> chance;
46 // NOLINTEND
47 };
48
49public:
50 // member variables
51 // NOLINTBEGIN
52 ::ll::TypedStorage<8, 8, ::Item&> mOwner;
53 ::ll::TypedStorage<4, 4, int> mNutrition;
54 ::ll::TypedStorage<4, 4, float> mSaturationModifier;
55 ::ll::TypedStorage<8, 32, ::std::string> mUsingConvertsTo;
56 ::ll::TypedStorage<4, 4, ::FoodItemComponentLegacy::OnUseAction> mOnUseAction;
57 ::ll::TypedStorage<4, 12, ::Vec3> mOnUseRange;
58 ::ll::TypedStorage<8, 48, ::HashedString> mCooldownCategory;
59 ::ll::TypedStorage<4, 4, int> mCooldownDuration;
60 ::ll::TypedStorage<1, 1, bool> mCanAlwaysEat;
61 ::ll::TypedStorage<8, 24, ::std::vector<::FoodItemComponentLegacy::Effect>> mEffects;
62 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mRemoveEffects;
63 // NOLINTEND
64
65public:
66 // prevent constructor by default
67 FoodItemComponentLegacy& operator=(FoodItemComponentLegacy const&);
68 FoodItemComponentLegacy(FoodItemComponentLegacy const&);
69 FoodItemComponentLegacy();
70
71public:
72 // virtual functions
73 // NOLINTBEGIN
74 virtual int getNutrition() const /*override*/;
75
76 virtual float getSaturationModifier() const /*override*/;
77
78 virtual bool canAlwaysEat() const /*override*/;
79
80 virtual ::Item const* eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level) /*override*/;
81
82 virtual void use(::ItemOnUseResult& result, ::ItemStack& instance, ::Player& player) /*override*/;
83
84 virtual ::Item const* useTimeDepleted(
85 ::ItemUseMethod& itemUseMethod,
86 ::ItemStack const&,
87 ::ItemStack& instance,
88 ::Player& player,
89 ::Level& level
90 ) /*override*/;
91 // NOLINTEND
92
93public:
94 // member functions
95 // NOLINTBEGIN
96 MCAPI void _applyEatEffects(::ItemStack const&, ::Actor& actor, ::Level& level);
97 // NOLINTEND
98
99public:
100 // virtual function thunks
101 // NOLINTBEGIN
102#ifdef LL_PLAT_S
103 MCAPI int $getNutrition() const;
104#else // LL_PLAT_C
105 MCFOLD int $getNutrition() const;
106#endif
107
108 MCFOLD float $getSaturationModifier() const;
109
110 MCAPI bool $canAlwaysEat() const;
111
112 MCAPI ::Item const* $eatItem(::ItemStack& instance, ::Actor& actor, ::Level& level);
113
114 MCAPI void $use(::ItemOnUseResult& result, ::ItemStack& instance, ::Player& player);
115
116 MCAPI ::Item const* $useTimeDepleted(
117 ::ItemUseMethod& itemUseMethod,
118 ::ItemStack const&,
119 ::ItemStack& instance,
120 ::Player& player,
121 ::Level& level
122 );
123
124
125 // NOLINTEND
126};
Definition Actor.h:113
Definition IFoodItemComponent.h:18
Definition ItemStack.h:26
Definition Item.h:71
Definition Level.h:254
Definition Player.h:129
Definition FoodItemComponentLegacy.h:36
Definition ItemOnUseResult.h:5