LeviLamina
Loading...
Searching...
No Matches
EnchantUtils.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/item/enchanting/Enchant.h"
7#include "mc/world/item/enchanting/EquipmentFilter.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
13class BlockSource;
15class Item;
16class ItemEnchants;
17class ItemInstance;
18class ItemStack;
19class ItemStackBase;
20class Mob;
21class Vec3;
22struct ActorUniqueID;
23namespace Bedrock::Safety { class RedactableString; }
24// clang-format on
25
27public:
28 // static functions
29 // NOLINTBEGIN
30 MCAPI static void _convertBookCheck(::ItemStackBase& out);
31
32 MCAPI static void appendEnchantToFormattedText(
33 ::Enchant::Type type,
34 ::std::string_view enchantName,
35 ::Bedrock::Safety::RedactableString& formattedEnchantmentText
36 );
37
38 MCAPI static bool applyEnchant(::ItemStackBase& out, ::Enchant::Type type, int level, bool allowNonVanilla);
39
40 MCAPI static int applyEnchant(::ItemStackBase& out, ::ItemEnchants const& enchants, bool allowNonVanilla);
41
42 MCAPI static float
43 calculateAfterBreachArmorFraction(::ActorUniqueID const& attackerID, ::Mob const& target, float armorFraction);
44
45 MCAPI static int
46 combineEnchantedItems(::ItemStack const& first, ::ItemStack const& second, ::ItemStack& out, bool bookEnchant);
47
48 MCAPI static void doPostDamageEffects(::Actor& victim, ::Actor& attacker);
49
50 MCAPI static void doPostHurtEffects(::Mob& victim, ::Mob& attacker);
51
52 MCAPI static void
53 doPostItemHurtActorEffects(::Actor& victim, ::Actor& attacker, ::ItemEnchants const& preHurtEnchantments);
54
55 MCAPI static ::ItemInstance generateEnchantedBook(::EnchantmentInstance const& enchant);
56
57 MCAPI static ::std::vector<::std::pair<::EnchantmentInstance, int>>
58 getAvailableEnchantmentResults(::Item const* item, int value, bool treasure);
59
60 MCAPI static ::std::vector<::Vec3> getBookCasePositions(::BlockSource& source, ::Vec3 const& pos);
61
62 MCAPI static void getCurses(::ItemStackBase const& item, ::std::vector<::EnchantmentInstance>& outputCurses);
63
64 MCAPI static float getDamageReduction(::ActorDamageSource const& source, ::Mob const& target);
65
66 MCAPI static ::std::vector<int> getEnchantCosts(::ItemStackBase const& itemInst, int bookcaseCount);
67
68 MCAPI static int getEnchantLevel(::Enchant::Type enchantType, ::ItemStackBase const& stack);
69
70 MCAPI static ::std::string getEnchantNameAndLevel(::Enchant::Type id, int level);
71
72 MCAPI static ::std::vector<::Vec3> getEnchantingTablePositions(::BlockSource& source, ::Vec3 const& pos);
73
74 MCAPI static ::std::string getLevelString(int level);
75
76 MCAPI static float getMeleeDamageBonus(::Actor const& victim, ::Actor& attacker);
77
78 MCAPI static ::ItemStack const& getRandomDamagedItemWithMending(::Mob const& equipped);
79
80 MCAPI static ::ItemStack const&
81 getRandomItemWith(::Enchant::Type type, ::Mob const& equipped, ::EquipmentFilter filter);
82
83 MCAPI static ::std::string getRandomName();
84
85 MCAPI static bool hasEnchant(::Enchant::Type enchantType, ::ItemStackBase const& item);
86
87 MCAPI static ::ItemEnchants selectEnchantments(::Item const* item, int enchantCost, int valueBuff, bool treasure);
88 // NOLINTEND
89
90public:
91 // static variables
92 // NOLINTBEGIN
93 MCAPI static int const& MAX_EXP_REPAIR_COST();
94
95 MCAPI static int const& PROTECTIONFACTOR_SECONDARYCAP();
96
97 MCAPI static ::std::vector<::std::string>& mEnchantmentNames();
98 // NOLINTEND
99};
Definition ActorDamageSource.h:18
Definition Actor.h:104
Definition RedactableString.h:10
Definition BlockSource.h:67
Definition EnchantUtils.h:26
Definition EnchantmentInstance.h:8
Definition ItemEnchants.h:17
Definition ItemInstance.h:16
Definition ItemStackBase.h:35
Definition ItemStack.h:25
Definition Item.h:65
Definition Mob.h:47
Definition Vec3.h:10
Definition ActorUniqueID.h:5