Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI ItemContext(::ItemStack const& item, int slot);
46
47 MCNAPI ItemContext(::BlockSource& region, ::BlockPos const& containerPos, int slot);
48
49 MCNAPI void _setItem(::ItemStack const& item);
50
51 MCNAPI ::Container* _tryGetContainerFromEntity() const;
52
53 MCNAPI ::Container* _tryGetContainerFromItem() const;
54
55 MCNAPI bool clearAllDynamicProperties(::std::string const& collection);
56
57 MCNAPI ::std::optional<int> getAmount() const;
58
59 MCNAPI ::std::optional<::std::vector<::std::string>> getCanDestroy() const;
60
61 MCNAPI ::std::optional<::std::vector<::std::string>> getCanPlaceOn() const;
62
63 MCNAPI ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>>
64 getDynamicProperty(::std::string const& collection, ::std::string const& key) const;
65
66 MCNAPI ::std::optional<::std::vector<::std::string>> getDynamicPropertyIds(::std::string const& collection) const;
67
68 MCNAPI ::std::optional<uint64> getDynamicPropertyTotalByteCount(::std::string const& collection) const;
69
70 MCNAPI ::std::optional<::std::string> getId() const;
71
72 MCNAPI ::std::optional<::ItemStack> getItem() const;
73
74 MCNAPI ::std::optional<bool> getKeepOnDeath() const;
75
76 MCNAPI ::std::optional<::ItemLockMode> getLockMode() const;
77
78 MCNAPI ::std::optional<::std::vector<::std::string>> getLore() const;
79
80 MCNAPI ::std::optional<int> getMaxAmount() const;
81
82 MCNAPI ::std::optional<::std::string> getNameTag() const;
83
84 MCNAPI ::std::optional<::std::vector<::ItemTag>> getTags() const;
85
86 MCNAPI ::std::optional<bool> hasItem() const;
87
88 MCNAPI ::std::optional<bool> hasTag(::ItemTag const& tag) const;
89
90 MCNAPI ::std::optional<bool> isStackable() const;
91
92 MCNAPI ::std::optional<bool> isStackableWith(::ItemStackBase const& other) const;
93
94 MCNAPI bool isValid() const;
95
96 MCNAPI ::ItemContext& operator=(::ItemContext const&);
97
98 MCNAPI bool setAmount(int amount);
99
100 MCNAPI ::std::optional<bool> setCanDestroy(::std::vector<::std::string> const& blockIdentifiers);
101
102 MCNAPI ::std::optional<bool> setCanPlaceOn(::std::vector<::std::string> const& blockIdentifiers);
103
105 ::std::string const& collection,
106 ::std::string const& key,
107 ::std::optional<::std::variant<double, float, bool, ::std::string, ::Vec3>> const& optionalValue
108 );
109
110 MCNAPI bool setKeepOnDeath(bool value);
111
112 MCNAPI bool setLockMode(::ItemLockMode lockMode);
113
114 MCNAPI bool setLore(::std::optional<::std::vector<::std::string>> const& loreList);
115
116 MCNAPI bool setNameTag(::std::optional<::std::string> nameTag);
117
118 MCNAPI ~ItemContext();
119 // NOLINTEND
120
121public:
122 // static functions
123 // NOLINTBEGIN
124 MCNAPI static bool
125 setEquipment(::ItemStack const& item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob& mob);
126 // NOLINTEND
127
128public:
129 // constructor thunks
130 // NOLINTBEGIN
131 MCNAPI void* $ctor(::ItemStack const& item, int slot);
132
133 MCNAPI void* $ctor(::BlockSource& region, ::BlockPos const& containerPos, int slot);
134 // NOLINTEND
135
136public:
137 // destructor thunk
138 // NOLINTBEGIN
139 MCNAPI void $dtor();
140 // NOLINTEND
141};
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition Container.h:36
MCAPI ::std::optional<::std::vector<::std::string > > getCanDestroy() const
MCAPI bool clearAllDynamicProperties(::std::string const &collection)
MCAPI bool setAmount(int amount)
MCAPI ::std::optional< bool > setCanDestroy(::std::vector<::std::string > const &blockIdentifiers)
MCAPI bool setLockMode(::ItemLockMode lockMode)
static MCAPI bool setEquipment(::ItemStack const &item, ::SharedTypes::Legacy::EquipmentSlot equipmentSlot, ::Mob &mob)
MCAPI ItemContext(::BlockSource &region, ::BlockPos const &containerPos, int slot)
MCAPI void * $ctor(::BlockSource &region, ::BlockPos const &containerPos, int slot)
MCAPI ::std::optional<::std::string > getNameTag() const
MCAPI ::std::optional<::ItemStack > getItem() const
MCAPI ::std::optional< int > getMaxAmount() const
MCAPI ::std::optional< uint64 > getDynamicPropertyTotalByteCount(::std::string const &collection) const
MCAPI ::std::optional<::std::vector<::std::string > > getDynamicPropertyIds(::std::string const &collection) const
MCAPI bool setNameTag(::std::optional<::std::string > nameTag)
MCAPI::Container * _tryGetContainerFromEntity() const
MCAPI ::std::optional< bool > isStackableWith(::ItemStackBase const &other) const
MCAPI ::std::optional<::std::vector<::ItemTag > > getTags() const
MCAPI ::std::optional<::std::vector<::std::string > > getLore() const
MCAPI ::std::optional< bool > hasTag(::ItemTag const &tag) const
MCAPI void * $ctor(::ItemStack const &item, int slot)
MCAPI bool setKeepOnDeath(bool value)
MCAPI bool setLore(::std::optional<::std::vector<::std::string > > const &loreList)
MCAPI ::std::optional< bool > hasItem() const
MCAPI::ItemContext & operator=(::ItemContext const &)
MCAPI ~ItemContext()
MCAPI bool setDynamicProperty(::std::string const &collection, ::std::string const &key, ::std::optional<::std::variant< double, float, bool, ::std::string, ::Vec3 > > const &optionalValue)
MCAPI ::std::optional< bool > setCanPlaceOn(::std::vector<::std::string > const &blockIdentifiers)
MCAPI ::std::optional<::std::string > getId() const
MCAPI bool isValid() const
MCAPI ::std::optional< int > getAmount() const
MCAPI ::std::optional<::std::variant< double, float, bool, ::std::string, ::Vec3 > > getDynamicProperty(::std::string const &collection, ::std::string const &key) const
MCAPI ::std::optional<::std::vector<::std::string > > getCanPlaceOn() const
MCAPI void _setItem(::ItemStack const &item)
MCAPI::Container * _tryGetContainerFromItem() const
MCAPI ItemContext(::ItemStack const &item, int slot)
MCAPI void $dtor()
MCAPI ::std::optional< bool > isStackable() const
MCAPI ::std::optional<::ItemLockMode > getLockMode() const
MCAPI ::std::optional< bool > getKeepOnDeath() const
Definition ItemStackBase.h:45
Definition ItemStack.h:26
Definition Mob.h:58
Definition Vec3.h:10
Definition ItemTag.h:8