LeviLamina
Loading...
Searching...
No Matches
MapItem.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/item/ComplexItem.h"
7#include "mc/world/level/saveddata/maps/MapItemSavedData.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class BlockPos;
13class BlockSource;
14class CompoundTag;
15class Dimension;
16class ILevel;
17class Item;
18class ItemDescriptor;
19class ItemStack;
20class ItemStackBase;
21class Level;
23class Packet;
24struct ActorUniqueID;
26struct MapSample;
28namespace Bedrock::Safety { class RedactableString; }
29// clang-format on
30
31class MapItem : public ::ComplexItem {
32public:
33 // prevent constructor by default
34 MapItem();
35
36public:
37 // virtual functions
38 // NOLINTBEGIN
39 virtual bool inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const
40 /*override*/;
41
42 virtual void refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const /*override*/;
43
44 virtual ::std::unique_ptr<::Packet> getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const
45 /*override*/;
46
47 virtual ::std::string
48 buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const /*override*/;
49
50 virtual void appendFormattedHovertext(
51 ::ItemStackBase const& stack,
52 ::Level& level,
54 bool const showCategory
55 ) const /*override*/;
56
57 virtual bool hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const /*override*/;
58
59 virtual ::ResolvedItemIconInfo getIconInfo(::ItemStackBase const& item, int, bool) const /*override*/;
60
61 virtual ::Item& setIconInfo(::std::string const& name, int id) /*override*/;
62
63 virtual void fixupCommon(::ItemStackBase& stack, ::ILevel& level) const /*override*/;
64 // NOLINTEND
65
66public:
67 // member functions
68 // NOLINTBEGIN
69 MCAPI MapItem(::std::string const& itemName, short itemId);
70
71 MCAPI void blockTick(::ItemStackBase const& item, ::BlockSource& region, ::BlockPos const& pos) const;
72
73 MCAPI void updateMap(::Level& level, ::Actor& player, ::MapItemSavedData& map) const;
74 // NOLINTEND
75
76public:
77 // static functions
78 // NOLINTBEGIN
79 MCAPI static void _scheduleMapChunkRendering(
80 ::Dimension& dimension,
81 ::MapItemSavedData const& original,
83 ::std::shared_ptr<bool> chunksRefCount
84 );
85
86 MCAPI static bool doesDisplayPlayerMarkers(::ItemStackBase const& item);
87
88 MCAPI static ::ActorUniqueID getMapId(::CompoundTag const* tag);
89
90 MCAPI static void markForRegeneration(::ItemStackBase& item);
91
92 MCAPI static void renderBiomePreviewMap(::Dimension& dimension, ::MapItemSavedData& data);
93
94 MCAPI static bool sampleMapData(
95 ::BlockSource& region,
96 int blocksPerTexel,
97 ::BlockPos const& worldOrigin,
98 ::BlockPos const& updateOrigin,
99 int imageWidth,
100 int imageHeight,
101 ::std::vector<::MapSample>* output,
102 ::MapItemSavedData* mapData,
103 ::std::vector<::ClientTerrainPixel>* clientPixels
104 );
105
106 MCAPI static void serializeMapData(::std::vector<::MapSample> const& mapSamples, ::std::string& output);
107
108 MCAPI static void setItemInstanceInfo(::ItemStackBase& item, ::MapItemSavedData& savedData);
109
110 MCAPI static void setMapNameIndex(::ItemStack& item, int mapNameIndex);
111 // NOLINTEND
112
113public:
114 // static variables
115 // NOLINTBEGIN
116 MCAPI static ::std::string const& TAG_MAP_INIT();
117
118 MCAPI static ::std::string const& TAG_MAP_NAME_INDEX();
119
120 MCAPI static ::std::string const& TAG_MAP_PLAYER_DISPLAY();
121
122 MCAPI static ::std::string const& TAG_MAP_REGENERATE();
123
124 MCAPI static ::std::string const& TAG_MAP_SCALE();
125
126 MCAPI static ::std::string const& TAG_MAP_SCALING();
127
128 MCAPI static ::std::string const& TAG_MAP_UUID();
129 // NOLINTEND
130
131public:
132 // constructor thunks
133 // NOLINTBEGIN
134 MCAPI void* $ctor(::std::string const& itemName, short itemId);
135 // NOLINTEND
136
137public:
138 // virtual function thunks
139 // NOLINTBEGIN
140 MCAPI bool $inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const;
141
142 MCAPI void $refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const;
143
144 MCAPI ::std::unique_ptr<::Packet> $getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const;
145
146 MCAPI ::std::string
147 $buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const;
148
149 MCAPI void $appendFormattedHovertext(
150 ::ItemStackBase const& stack,
151 ::Level& level,
153 bool const showCategory
154 ) const;
155
156 MCAPI bool $hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const;
157
158 MCFOLD ::ResolvedItemIconInfo $getIconInfo(::ItemStackBase const& item, int, bool) const;
159
160 MCFOLD ::Item& $setIconInfo(::std::string const& name, int id);
161
162 MCAPI void $fixupCommon(::ItemStackBase& stack, ::ILevel& level) const;
163
164
165 // NOLINTEND
166
167public:
168 // vftables
169 // NOLINTBEGIN
170 MCAPI static void** $vftable();
171 // NOLINTEND
172};
Definition Actor.h:125
Definition RedactableString.h:10
Definition BlockPos.h:21
Definition BlockSource.h:73
Definition CompoundTag.h:23
Definition Dimension.h:89
Definition ILevel.h:219
Definition ItemDescriptor.h:25
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition Item.h:71
Definition Level.h:255
Definition MapItemSavedData.h:32
Definition Packet.h:31
Definition ActorUniqueID.h:10
Definition ClientTerrainPixel.h:5
Definition MapItemSavedData.h:42
Definition MapSample.h:13
Definition ResolvedItemIconInfo.h:8