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 HashedString;
16class Item;
17class ItemEnchants;
18class ItemInstance;
19class ItemStack;
20class ItemStackBase;
21class Mob;
22class Vec3;
23struct ActorUniqueID;
24namespace Bedrock::Safety { class RedactableString; }
25// clang-format on
26
28public:
29 // static functions
30 // NOLINTBEGIN
31 MCAPI static void _convertBookCheck(::ItemStackBase& out);
32
33 MCAPI static void appendEnchantToFormattedText(
34 ::Enchant::Type type,
35 ::std::string_view enchantName,
36 ::Bedrock::Safety::RedactableString& formattedEnchantmentText
37 );
38
39 MCAPI static bool applyEnchant(::ItemStackBase& out, ::Enchant::Type type, int level, bool allowNonVanilla);
40
41 MCAPI static int applyEnchant(::ItemStackBase& out, ::ItemEnchants const& enchants, bool allowNonVanilla);
42
43 MCAPI static float
44 calculateAfterBreachArmorFraction(::ActorUniqueID const& attackerID, ::Mob const& target, float armorFraction);
45
46 MCAPI static int
47 combineEnchantedItems(::ItemStack const& first, ::ItemStack const& second, ::ItemStack& out, bool bookEnchant);
48
49 MCAPI static void doPostDamageEffects(::Actor& victim, ::Actor& attacker);
50
51 MCAPI static void doPostHurtEffects(::Mob& victim, ::Mob& attacker);
52
53 MCAPI static ::ItemInstance generateEnchantedBook(::EnchantmentInstance const& enchant);
54
55 MCAPI static ::std::vector<::std::pair<::EnchantmentInstance, int>>
56 getAvailableEnchantmentResults(::Item const* item, int value, bool treasure);
57
58 MCAPI static ::std::vector<::Vec3> getBookCasePositions(::BlockSource& source, ::Vec3 const& pos);
59
60 MCAPI static void getCurses(::ItemStackBase const& item, ::std::vector<::EnchantmentInstance>& outputCurses);
61
62 MCAPI static float getDamageReduction(::ActorDamageSource const& source, ::Mob const& target);
63
64 MCAPI static ::std::vector<int> getEnchantCosts(::ItemStackBase const& itemInst, int bookcaseCount);
65
66 MCAPI static int getEnchantLevel(::Enchant::Type enchantType, ::ItemStackBase const& stack);
67
68 MCAPI static ::std::string getEnchantNameAndLevel(::Enchant::Type id, int level);
69
70 MCAPI static ::std::vector<::Vec3> getEnchantingTablePositions(::BlockSource& source, ::Vec3 const& pos);
71
72 MCAPI static ::Enchant::Type getEnchantmentId(::HashedString const& stringId);
73
74 MCAPI static ::std::string getLevelString(int level);
75
76 MCAPI static float getMeleeDamageBonus(::Actor const& victim, ::Actor const& 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 bool hasEnchant(::Enchant::Type enchantType, ::ItemStackBase const& item);
84
85 MCAPI static ::ItemEnchants selectEnchantments(::Item const* item, int enchantCost, int valueBuff, bool treasure);
86 // NOLINTEND
87
88public:
89 // static variables
90 // NOLINTBEGIN
91 MCAPI static int const& MAX_EXP_REPAIR_COST();
92
93 MCAPI static int const& PROTECTIONFACTOR_SECONDARYCAP();
94
95 MCAPI static ::std::vector<::std::string>& mEnchantmentNames();
96 // NOLINTEND
97};
Definition ActorDamageSource.h:18
Definition Actor.h:102
Definition RedactableString.h:10
Definition BlockSource.h:66
Definition EnchantUtils.h:27
Definition EnchantmentInstance.h:8
Definition HashedString.h:5
Definition ItemEnchants.h:17
Definition ItemInstance.h:15
Definition ItemStackBase.h:34
Definition ItemStack.h:23
Definition Item.h:66
Definition Mob.h:47
Definition Vec3.h:10
Definition ActorUniqueID.h:5