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;
24// clang-format on
25
26namespace EnchantUtils {
27// functions
28// NOLINTBEGIN
29MCAPI bool applyEnchant(::ItemStackBase& out, ::Enchant::Type type, int level, bool allowNonVanilla);
30
31MCAPI int applyEnchant(::ItemStackBase& out, ::ItemEnchants const& enchants, bool allowNonVanilla);
32
33MCAPI float
34calculateAfterBreachArmorFraction(::ActorUniqueID const& attackerID, ::Mob const& target, float armorFraction);
35
36MCAPI int
37combineEnchantedItems(::ItemStack const& first, ::ItemStack const& second, ::ItemStack& out, bool bookEnchant);
38
39MCAPI void doPostHurtEffects(::Mob& victim, ::Mob& attacker);
40
41MCAPI void doPostPiercingAttackEffects(::Actor& attacker);
42
43MCAPI void doPreDamageEffects(::Actor& victim, ::Actor& attacker);
44
45MCAPI ::ItemInstance generateEnchantedBook(::EnchantmentInstance const& enchant);
46
47MCAPI ::std::vector<::std::pair<::EnchantmentInstance, int>>
48getAvailableEnchantmentResults(::Item const* item, int value, bool treasure);
49
50MCAPI ::std::vector<::Vec3> getBookCasePositions(::BlockSource& source, ::Vec3 const& pos);
51
52MCAPI void getCurses(::ItemStackBase const& item, ::std::vector<::EnchantmentInstance>& outputCurses);
53
54MCAPI float getDamageReduction(::ActorDamageSource const& source, ::Mob const& target);
55
56MCAPI ::std::vector<int> getEnchantCosts(::ItemStackBase const& itemInst, int bookcaseCount);
57
58MCAPI int getEnchantLevel(::Enchant::Type enchantType, ::ItemStackBase const& stack);
59
60MCAPI ::std::string getEnchantNameAndLevel(::Enchant::Type id, int level);
61
62MCAPI ::std::vector<::Vec3> getEnchantingTablePositions(::BlockSource& source, ::Vec3 const& pos);
63
64MCAPI ::Enchant::Type getEnchantmentId(::HashedString const& stringId);
65
66MCAPI ::std::string getLevelString(int level);
67
68MCAPI float getMeleeDamageBonus(::Actor const& victim, ::Actor const& attacker);
69
70MCAPI ::ItemStack const& getRandomDamagedItemWithMending(::Mob const& equipped);
71
72MCAPI ::ItemStack const& getRandomItemWith(::Enchant::Type type, ::Mob const& equipped, ::EquipmentFilter filter);
73
74MCAPI bool hasEnchant(::Enchant::Type enchantType, ::ItemStackBase const& item);
75
76MCAPI ::ItemEnchants selectEnchantments(::Item const* item, int enchantCost, int valueBuff, bool treasure);
77// NOLINTEND
78
79} // namespace EnchantUtils
Definition ActorDamageSource.h:18
Definition Actor.h:105
Definition BlockSource.h:68
Definition EnchantmentInstance.h:8
Definition HashedString.h:5
Definition ItemEnchants.h:17
Definition ItemInstance.h:15
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Item.h:69
Definition Mob.h:50
Definition Vec3.h:10
Definition ActorUniqueID.h:5