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
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 // NOLINTEND
61
62public:
63 // member functions
64 // NOLINTBEGIN
65 MCAPI void blockTick(::ItemStackBase const& item, ::BlockSource& region, ::BlockPos const& pos) const;
66 // NOLINTEND
67
68public:
69 // static functions
70 // NOLINTBEGIN
71 MCAPI static void _scheduleMapChunkRendering(
72 ::Dimension& dimension,
73 ::MapItemSavedData const& original,
75 ::std::shared_ptr<bool> chunksRefCount
76 );
77
78 MCAPI static bool doesDisplayPlayerMarkers(::ItemStackBase const& item);
79
80 MCAPI static ::ActorUniqueID getMapId(::CompoundTag const* tag);
81
82 MCAPI static void markForRegeneration(::ItemStackBase& item);
83
84 MCAPI static void renderBiomePreviewMap(::Dimension& dimension, ::MapItemSavedData& data);
85
86 MCAPI static bool sampleMapData(
87 ::BlockSource& region,
88 int blocksPerTexel,
89 ::BlockPos const& worldOrigin,
90 ::BlockPos const& updateOrigin,
91 int imageWidth,
92 int imageHeight,
93 ::std::vector<::MapSample>* output,
94 ::MapItemSavedData* mapData,
95 ::std::vector<::ClientTerrainPixel>* clientPixels
96 );
97
98 MCAPI static void serializeMapData(::std::vector<::MapSample> const& mapSamples, ::std::string& output);
99
100 MCAPI static void setItemInstanceInfo(::ItemStackBase& item, ::MapItemSavedData& savedData);
101
102 MCAPI static void setMapNameIndex(::ItemStack& item, int mapNameIndex);
103 // NOLINTEND
104
105public:
106 // static variables
107 // NOLINTBEGIN
108 MCAPI static ::std::string const& TAG_MAP_INIT();
109
110 MCAPI static ::std::string const& TAG_MAP_NAME_INDEX();
111
112 MCAPI static ::std::string const& TAG_MAP_PLAYER_DISPLAY();
113
114 MCAPI static ::std::string const& TAG_MAP_REGENERATE();
115
116 MCAPI static ::std::string const& TAG_MAP_SCALE();
117
118 MCAPI static ::std::string const& TAG_MAP_SCALING();
119
120 MCAPI static ::std::string const& TAG_MAP_UUID();
121 // NOLINTEND
122
123public:
124 // virtual function thunks
125 // NOLINTBEGIN
126 MCAPI bool $inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const;
127
128 MCAPI void $refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const;
129
130 MCAPI ::std::unique_ptr<::Packet> $getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const;
131
132 MCAPI ::std::string
133 $buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const;
134
135 MCAPI void $appendFormattedHovertext(
136 ::ItemStackBase const& stack,
137 ::Level& level,
139 bool const
140 ) const;
141
142 MCAPI bool $hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const;
143
144 MCFOLD ::ResolvedItemIconInfo $getIconInfo(::ItemStackBase const& item, int, bool) const;
145
146 MCFOLD ::Item& $setIconInfo(::std::string const& name, int id);
147
148 MCAPI void $fixupCommon(::ItemStackBase& stack, ::ILevel& level) const;
149
150
151 // NOLINTEND
152
153public:
154 // vftables
155 // NOLINTBEGIN
156 MCAPI static void** $vftable();
157 // NOLINTEND
158};
Definition Actor.h:114
Definition RedactableString.h:10
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition ComplexItem.h:16
Definition CompoundTag.h:18
Definition Dimension.h:86
Definition ILevel.h:220
Definition ItemDescriptor.h:26
Definition ItemStackBase.h:44
Definition ItemStack.h:24
Definition Item.h:71
Definition Level.h:253
Definition MapItemSavedData.h:32
Definition MapItem.h:31
Definition Packet.h:29
Definition ActorUniqueID.h:5
Definition ClientTerrainPixel.h:5
Definition MapItemSavedData.h:42
Definition MapSample.h:13
Definition ResolvedItemIconInfo.h:8