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