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 // virtual functions
34 // NOLINTBEGIN
35 virtual bool inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const
36 /*override*/;
37
38 virtual void refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const /*override*/;
39
40 virtual ::std::unique_ptr<::Packet> getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const
41 /*override*/;
42
43 virtual ::std::string
44 buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const /*override*/;
45
46 virtual void appendFormattedHovertext(
47 ::ItemStackBase const& stack,
48 ::Level& level,
50 bool const showCategory
51 ) const /*override*/;
52
53 virtual bool hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const /*override*/;
54
55 virtual ::ResolvedItemIconInfo getIconInfo(::ItemStackBase const& item, int, bool) const /*override*/;
56
57 virtual ::Item& setIconInfo(::std::string const& name, int id) /*override*/;
58
59 virtual void fixupCommon(::ItemStackBase& stack, ::ILevel& level) const /*override*/;
60
61 virtual ~MapItem() /*override*/ = default;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI void updateMap(::Level& level, ::Actor& player, ::MapItemSavedData& map) const;
68 // NOLINTEND
69
70public:
71 // static functions
72 // NOLINTBEGIN
73 MCAPI static void _scheduleMapChunkRendering(
74 ::Dimension& dimension,
75 ::MapItemSavedData const& original,
77 ::std::shared_ptr<bool> chunksRefCount
78 );
79
80 MCAPI static bool doesDisplayPlayerMarkers(::ItemStackBase const& item);
81
82 MCAPI static ::ActorUniqueID getMapId(::CompoundTag const* tag);
83
84 MCAPI static void markForRegeneration(::ItemStackBase& item);
85
86 MCAPI static void renderBiomePreviewMap(::Dimension& dimension, ::MapItemSavedData& data);
87
88 MCAPI static bool sampleMapData(
89 ::BlockSource& region,
90 int blocksPerTexel,
91 ::BlockPos const& worldOrigin,
92 ::BlockPos const& updateOrigin,
93 int imageWidth,
94 int imageHeight,
95 ::std::vector<::MapSample>* output,
96 ::MapItemSavedData* mapData,
97 ::std::vector<::ClientTerrainPixel>* clientPixels
98 );
99
100 MCAPI static void serializeMapData(::std::vector<::MapSample> const& mapSamples, ::std::string& output);
101 // NOLINTEND
102
103public:
104 // static variables
105 // NOLINTBEGIN
106 MCAPI static ::std::string const& TAG_MAP_INIT();
107
108 MCAPI static ::std::string const& TAG_MAP_NAME_INDEX();
109
110 MCAPI static ::std::string const& TAG_MAP_PLAYER_DISPLAY();
111
112 MCAPI static ::std::string const& TAG_MAP_REGENERATE();
113
114 MCAPI static ::std::string const& TAG_MAP_SCALE();
115
116 MCAPI static ::std::string const& TAG_MAP_SCALING();
117
118 MCAPI static ::std::string const& TAG_MAP_UUID();
119 // NOLINTEND
120
121public:
122 // virtual function thunks
123 // NOLINTBEGIN
124 MCAPI bool $inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const;
125
126 MCAPI void $refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const;
127
128 MCAPI ::std::unique_ptr<::Packet> $getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const;
129
130 MCAPI ::std::string
131 $buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const;
132
133 MCAPI void $appendFormattedHovertext(
134 ::ItemStackBase const& stack,
135 ::Level& level,
137 bool const showCategory
138 ) const;
139
140 MCAPI bool $hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const;
141
142 MCFOLD ::ResolvedItemIconInfo $getIconInfo(::ItemStackBase const& item, int, bool) const;
143
144 MCFOLD ::Item& $setIconInfo(::std::string const& name, int id);
145
146 MCAPI void $fixupCommon(::ItemStackBase& stack, ::ILevel& level) const;
147
148
149 // NOLINTEND
150
151public:
152 // vftables
153 // NOLINTBEGIN
154 MCAPI static void** $vftable();
155 // NOLINTEND
156};
Definition Actor.h:105
Definition RedactableString.h:10
Definition BlockPos.h:19
Definition BlockSource.h:68
Definition ComplexItem.h:16
Definition CompoundTag.h:23
Definition Dimension.h:85
Definition ILevel.h:214
Definition ItemDescriptor.h:23
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition Item.h:69
Definition Level.h:249
Definition MapItemSavedData.h:33
Definition MapItem.h:31
Definition Packet.h:28
Definition ActorUniqueID.h:5
Definition ClientTerrainPixel.h:5
Definition MapItemSavedData.h:43
Definition MapSample.h:13
Definition ResolvedItemIconInfo.h:8