LeviLamina
Loading...
Searching...
No Matches
ItemContext.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/ecs/WeakEntityRef.h"
7#include "mc/deps/shared_types/legacy/EquipmentSlot.h"
8#include "mc/world/item/ItemContextType.h"
9#include "mc/world/item/ItemLockMode.h"
10#include "mc/world/item/ItemStack.h"
11#include "mc/world/level/BlockPos.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockSource;
16class Container;
17class ItemStackBase;
18class Mob;
19class Vec3;
20struct ItemTag;
21// clang-format on
22
23class ItemContext {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<4, 4, ::ItemContextType> mItemContextType;
28 ::ll::TypedStorage<8, 8, ::Container*> mContainer;
29 ::ll::TypedStorage<4, 4, int> mSlot;
30 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::EquipmentSlot> mEquipmentSlot;
31 ::ll::TypedStorage<8, 8, ::BlockSource*> mBlockSource;
32 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
33 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mEntityRef;
34 ::ll::TypedStorage<8, 160, ::std::optional<::ItemStack>> mItemStackContainer;
35 // NOLINTEND
36
37public:
38 // prevent constructor by default
39 ItemContext(ItemContext const&);
40 ItemContext();
41
42public:
43 // member functions
44 // NOLINTBEGIN
45 MCAPI ItemContext(::ItemStack const& item, int slot);
46
47 MCAPI ItemContext(::BlockSource& region, ::BlockPos const& containerPos, int slot);
48
49 MCAPI void _setItem(::ItemStack const& item);
50
51 MCAPI ::Container* _tryGetContainerFromEntity() const;
52
53 MCAPI ::Container* _tryGetContainerFromItem() const;
54
55 MCAPI bool clearAllDynamicProperties(::std::string const& collection);
56
57 MCAPI ::std::optional<int> getAmount() const;
58
59 MCAPI ::std::optional<::std::vector<::std::string>> getCanDestroy() const;
60
61 MCAPI ::std::optional<::std::vector<::std::string>> getCanPlaceOn() const;
62
63 MCAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
64 getDynamicProperty(::std::string const& collection, ::std::string const& key) const;
65
66 MCAPI ::std::optional<::std::vector<::std::string>> getDynamicPropertyIds(::std::string const& collection) const;
67
68 MCAPI ::std::optional<uint64> getDynamicPropertyTotalByteCount(::std::string const& collection) const;
69
70 MCAPI ::std::optional<::std::string> getId() const;
71
72 MCAPI ::std::optional<::ItemStack> getItem() const;
73
74 MCAPI ::std::optional<bool> getKeepOnDeath() const;
75
76 MCAPI ::std::optional<::ItemLockMode> getLockMode() const;
77
78 MCAPI ::std::optional<::std::vector<::std::string>> getLore() const;
79
80 MCAPI ::std::optional<int> getMaxAmount() const;
81
82 MCAPI ::std::optional<::std::string> getNameTag() const;
83
84 MCAPI ::std::optional<::std::vector<::ItemTag>> getTags() const;
85
86 MCAPI ::std::optional<bool> hasItem() const;
87
88 MCAPI ::std::optional<bool> hasTag(::ItemTag const& tag) const;
89
90 MCAPI ::std::optional<bool> isStackable() const;
91
92 MCAPI ::std::optional<bool> isStackableWith(::ItemStackBase const& other) const;
93
94 MCAPI bool isValid() const;
95
96 MCAPI ::ItemContext& operator=(::ItemContext&&);
97
98 MCAPI ::ItemContext& operator=(::ItemContext const&);
99
100 MCAPI bool setAmount(int amount);
101
102 MCAPI ::std::optional<bool> setCanDestroy(::std::vector<::std::string> const& blockIdentifiers);
103
104 MCAPI ::std::optional<bool> setCanPlaceOn(::std::vector<::std::string> const& blockIdentifiers);
105
106 MCAPI bool setDynamicProperty(
107 ::std::string const& collection,
108 ::std::string const& key,
109 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
110 );
111
112 MCAPI bool setKeepOnDeath(bool value);
113
114 MCAPI bool setLockMode(::ItemLockMode lockMode);
115
116 MCAPI bool setLore(::std::optional<::std::vector<::std::string>> const& loreList);
117
118 MCAPI bool setNameTag(::std::optional<::std::string> nameTag);
119
120 MCAPI ~ItemContext();
121 // NOLINTEND
122
123public:
124 // static functions
125 // NOLINTBEGIN
126 MCAPI static bool
127 setEquipment(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
128 // NOLINTEND
129
130public:
131 // constructor thunks
132 // NOLINTBEGIN
133 MCAPI void* $ctor(::ItemStack const& item, int slot);
134
135 MCAPI void* $ctor(::BlockSource& region, ::BlockPos const& containerPos, int slot);
136 // NOLINTEND
137
138public:
139 // destructor thunk
140 // NOLINTBEGIN
141 MCAPI void $dtor();
142 // NOLINTEND
143};
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Container.h:35
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Mob.h:56
Definition Vec3.h:10
Definition ItemTag.h:8