Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
Potion.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/effect/MobEffectInstance.h"
7#include "mc/world/item/alchemy/PotionType.h"
8#include "mc/world/item/alchemy/PotionVariant.h"
9
10// auto generated forward declare list
11// clang-format off
12class BaseGameVersion;
13class Experiments;
14class Player;
15namespace Bedrock::Safety { class RedactableString; }
16// clang-format on
17
18class Potion {
19public:
20 // member variables
21 // NOLINTBEGIN
22 ::ll::TypedStorage<4, 4, int> mId;
23 ::ll::TypedStorage<8, 32, ::std::string> mNameId;
24 ::ll::TypedStorage<8, 32, ::std::string> mPrefix;
25 ::ll::TypedStorage<8, 24, ::std::vector<::MobEffectInstance>> mEffects;
26 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mDescriptionIds;
27 ::ll::TypedStorage<4, 4, ::PotionVariant> mVar;
28 // NOLINTEND
29
30public:
31 // prevent constructor by default
32 Potion();
33
34public:
35 // member functions
36 // NOLINTBEGIN
37 MCNAPI Potion(::std::string_view const nameId, ::std::string_view const prefix);
38
39 MCNAPI Potion(
40 ::std::string_view const nameId,
41 ::std::string_view const descriptionID,
42 ::MobEffectInstance const& mobEffect,
43 ::PotionVariant var
44 );
45
46 MCNAPI Potion(
47 ::std::string_view const nameId,
48 ::std::vector<::std::string> descriptionIDs,
49 ::std::vector<::MobEffectInstance> mobEffects,
50 ::PotionVariant var
51 );
52
55 ::PotionType potionType,
56 ::PotionVariant potionVariant,
57 ::Player const& player,
58 float timeMod
59 ) const;
60
61 MCNAPI ::std::string getDescriptionId() const;
62
63 MCAPI ::std::string getDescriptionId(::PotionType potionType) const;
64
65 MCNAPI ::std::string getNameId() const;
66
67 MCNAPI ::std::string getPotencyDescription(::PotionType potionType, float timeMod) const;
68
69 MCNAPI ::std::string getPrefix() const;
70 // NOLINTEND
71
72public:
73 // static functions
74 // NOLINTBEGIN
75 MCNAPI static void addPotion(::std::shared_ptr<::Potion const> const potion);
76
77 MCNAPI static void appendMobEffectText(
79 ::PotionVariant potionVariant,
80 uint mobEffectId,
81 int amplifier,
82 ::Player const& player
83 );
84
85 MCAPI static ::std::string
86 effectDurationToString(::PotionType potionType, float timeMod, ::MobEffectInstance const& effect);
87
88 MCNAPI static ::std::string effectPotencyToString(::MobEffectInstance const& effect);
89
90 MCNAPI static ::std::string getBasePotion(::PotionType type);
91
92 MCNAPI static ::std::string getPotencyDescription(
93 ::PotionType potionType,
94 float timeMod,
95 ::std::string_view const descID,
96 ::MobEffectInstance const& effect
97 );
98
99 MCNAPI static ::std::shared_ptr<::Potion const> getPotion(::std::string_view potionNameId);
100
101 MCNAPI static void initPotions(::BaseGameVersion const& baseGameVersion, ::Experiments const& experiments);
102 // NOLINTEND
103
104public:
105 // static variables
106 // NOLINTBEGIN
107 MCNAPI static ::std::shared_ptr<::Potion const> const& Awkward();
108
109 MCNAPI static ::std::shared_ptr<::Potion const> const& FireResistance();
110
111 MCNAPI static ::std::shared_ptr<::Potion const> const& Healing();
112
113 MCNAPI static ::std::shared_ptr<::Potion const> const& Poison();
114
115 MCNAPI static ::std::shared_ptr<::Potion const> const& Slowness();
116
117 MCNAPI static ::std::shared_ptr<::Potion const> const& Swiftness();
118
119 MCNAPI static ::std::shared_ptr<::Potion const> const& Water();
120
121 MCNAPI static ::std::shared_ptr<::Potion const> const& WaterBreathing();
122
123 MCNAPI static ::std::shared_ptr<::Potion const> const& Weakness();
124
125 MCNAPI static int& mLastId();
126
127 MCAPI static ::std::array<::std::shared_ptr<::Potion const>, 64>& mPotionsById();
128
129 MCNAPI static ::std::unordered_map<::std::string, int>& mPotionsByName();
130 // NOLINTEND
131
132public:
133 // constructor thunks
134 // NOLINTBEGIN
135 MCNAPI void* $ctor(::std::string_view const nameId, ::std::string_view const prefix);
136
137 MCNAPI void* $ctor(
138 ::std::string_view const nameId,
139 ::std::string_view const descriptionID,
140 ::MobEffectInstance const& mobEffect,
141 ::PotionVariant var
142 );
143
144 MCNAPI void* $ctor(
145 ::std::string_view const nameId,
146 ::std::vector<::std::string> descriptionIDs,
147 ::std::vector<::MobEffectInstance> mobEffects,
148 ::PotionVariant var
149 );
150 // NOLINTEND
151};
Definition BaseGameVersion.h:8
Definition RedactableString.h:10
Definition Experiments.h:14
Definition MobEffectInstance.h:16
Definition Player.h:131
static MCAPI ::std::unordered_map<::std::string, int > & mPotionsByName()
MCAPI::std::string getPotencyDescription(::PotionType potionType, float timeMod) const
MCAPI::std::string getDescriptionId() const
static MCAPI void addPotion(::std::shared_ptr<::Potion const > const potion)
static MCAPI int & mLastId()
MCAPI void * $ctor(::std::string_view const nameId, ::std::string_view const descriptionID, ::MobEffectInstance const &mobEffect, ::PotionVariant var)
MCAPI Potion(::std::string_view const nameId, ::std::string_view const descriptionID, ::MobEffectInstance const &mobEffect, ::PotionVariant var)
MCAPI::std::string getNameId() const
static MCAPI ::std::shared_ptr<::Potion const > getPotion(::std::string_view potionNameId)
MCAPI void * $ctor(::std::string_view const nameId, ::std::string_view const prefix)
static MCAPI void appendMobEffectText(::Bedrock::Safety::RedactableString &inOutHovertext, ::PotionVariant potionVariant, uint mobEffectId, int amplifier, ::Player const &player)
MCAPI Potion(::std::string_view const nameId, ::std::string_view const prefix)
static MCAPI ::std::shared_ptr<::Potion const > const & FireResistance()
MCAPI void * $ctor(::std::string_view const nameId, ::std::vector<::std::string > descriptionIDs, ::std::vector<::MobEffectInstance > mobEffects, ::PotionVariant var)
static MCAPI ::std::string getBasePotion(::PotionType type)
static MCAPI ::std::shared_ptr<::Potion const > const & Weakness()
static MCAPI ::std::shared_ptr<::Potion const > const & Swiftness()
static MCAPI ::std::string getPotencyDescription(::PotionType potionType, float timeMod, ::std::string_view const descID, ::MobEffectInstance const &effect)
MCAPI void appendFormattedPotionText(::Bedrock::Safety::RedactableString &inOutHovertext, ::PotionType potionType, ::PotionVariant potionVariant, ::Player const &player, float timeMod) const
MCAPI::std::string getPrefix() const
static MCAPI ::std::shared_ptr<::Potion const > const & WaterBreathing()
static MCAPI ::std::shared_ptr<::Potion const > const & Slowness()
static MCAPI ::std::string effectPotencyToString(::MobEffectInstance const &effect)
MCAPI Potion(::std::string_view const nameId, ::std::vector<::std::string > descriptionIDs, ::std::vector<::MobEffectInstance > mobEffects, ::PotionVariant var)
static MCAPI void initPotions(::BaseGameVersion const &baseGameVersion, ::Experiments const &experiments)
static MCAPI ::std::shared_ptr<::Potion const > const & Poison()
static MCAPI ::std::shared_ptr<::Potion const > const & Water()
static MCAPI ::std::shared_ptr<::Potion const > const & Healing()
static MCAPI ::std::shared_ptr<::Potion const > const & Awkward()