Skip to content
LeviMC
English
AutoLightDark
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 MCNAPI 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 MCNAPI static ::ActorUniqueID getMapId(::CompoundTag const* tag);
81
82 MCNAPI static void markForRegeneration(::ItemStackBase& item);
83
84 MCAPI static void renderBiomePreviewMap(::Dimension& dimension, ::MapItemSavedData& data);
85
86 MCNAPI 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 MCNAPI static void serializeMapData(::std::vector<::MapSample> const& mapSamples, ::std::string& output);
99
100 MCAPI static void setItemInstanceInfo(::ItemStackBase& item, ::MapItemSavedData& savedData);
101
102 MCNAPI static void setMapNameIndex(::ItemStack& item, int mapNameIndex);
103 // NOLINTEND
104
105public:
106 // static variables
107 // NOLINTBEGIN
108 MCNAPI static ::std::string const& TAG_MAP_INIT();
109
110 MCNAPI static ::std::string const& TAG_MAP_NAME_INDEX();
111
112 MCNAPI static ::std::string const& TAG_MAP_PLAYER_DISPLAY();
113
114 MCNAPI static ::std::string const& TAG_MAP_REGENERATE();
115
116 MCNAPI static ::std::string const& TAG_MAP_SCALE();
117
118 MCNAPI 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 MCNAPI bool $inventoryTick(::ItemStack& item, ::Level& level, ::Actor& owner, int slot, bool selected) const;
127
128 MCNAPI void $refreshedInContainer(::ItemStackBase const& stack, ::Level& level) const;
129
130 MCNAPI ::std::unique_ptr<::Packet> $getUpdatePacket(::ItemStack const& item, ::Level& level, ::Actor& player) const;
131
132 MCNAPI ::std::string
133 $buildDescriptionId(::ItemDescriptor const& itemDescriptor, ::CompoundTag const* userData) const;
134
136 ::ItemStackBase const& stack,
137 ::Level& level,
139 bool const
140 ) const;
141
142 MCNAPI bool $hasSameRelevantUserData(::ItemStackBase const& stack, ::ItemStackBase const& other) const;
143
144 MCNAPI ::ResolvedItemIconInfo $getIconInfo(::ItemStackBase const& item, int, bool) const;
145
146 MCNAPI ::Item& $setIconInfo(::std::string const& name, int id);
147
148 MCNAPI void $fixupCommon(::ItemStackBase& stack, ::ILevel& level) const;
149
150
151 // NOLINTEND
152
153public:
154 // vftables
155 // NOLINTBEGIN
156 MCNAPI static void** $vftable();
157 // NOLINTEND
158};
Definition Actor.h:116
Definition RedactableString.h:10
Definition BlockPos.h:14
Definition BlockSource.h:72
Definition ComplexItem.h:16
Definition CompoundTag.h:18
Definition Dimension.h:86
Definition ILevel.h:223
Definition ItemDescriptor.h:24
Definition ItemStackBase.h:45
Definition ItemStack.h:26
Definition Item.h:73
Definition Level.h:255
Definition MapItemSavedData.h:32
Definition MapItem.h:31
MCAPI::std::string $buildDescriptionId(::ItemDescriptor const &itemDescriptor, ::CompoundTag const *userData) const
static MCAPI ::std::string const & TAG_MAP_INIT()
MCAPI::Item & $setIconInfo(::std::string const &name, int id)
static MCAPI void _scheduleMapChunkRendering(::Dimension &dimension, ::MapItemSavedData const &original, ::MapItemSavedData::ChunkBounds bb, ::std::shared_ptr< bool > chunksRefCount)
static MCAPI ::std::string const & TAG_MAP_SCALE()
MCAPI ::std::unique_ptr<::Packet > $getUpdatePacket(::ItemStack const &item, ::Level &level, ::Actor &player) const
static MCAPI void serializeMapData(::std::vector<::MapSample > const &mapSamples, ::std::string &output)
static MCAPI void setMapNameIndex(::ItemStack &item, int mapNameIndex)
MCAPI void $appendFormattedHovertext(::ItemStackBase const &stack, ::Level &level, ::Bedrock::Safety::RedactableString &hovertext, bool const) const
static MCAPI ::std::string const & TAG_MAP_REGENERATE()
MCAPI bool $hasSameRelevantUserData(::ItemStackBase const &stack, ::ItemStackBase const &other) const
MCAPI bool $inventoryTick(::ItemStack &item, ::Level &level, ::Actor &owner, int slot, bool selected) const
static MCAPI ::std::string const & TAG_MAP_PLAYER_DISPLAY()
MCAPI void $refreshedInContainer(::ItemStackBase const &stack, ::Level &level) const
static MCAPI bool sampleMapData(::BlockSource &region, int blocksPerTexel, ::BlockPos const &worldOrigin, ::BlockPos const &updateOrigin, int imageWidth, int imageHeight, ::std::vector<::MapSample > *output, ::MapItemSavedData *mapData, ::std::vector<::ClientTerrainPixel > *clientPixels)
static MCAPI ::std::string const & TAG_MAP_SCALING()
static MCAPI void ** $vftable()
MCAPI void $fixupCommon(::ItemStackBase &stack, ::ILevel &level) const
MCAPI::ResolvedItemIconInfo $getIconInfo(::ItemStackBase const &item, int, bool) const
static MCAPI ::ActorUniqueID getMapId(::CompoundTag const *tag)
static MCAPI ::std::string const & TAG_MAP_NAME_INDEX()
static MCAPI void markForRegeneration(::ItemStackBase &item)
Definition Packet.h:29
Definition ActorUniqueID.h:5
Definition ClientTerrainPixel.h:5
Definition MapItemSavedData.h:42
Definition MapSample.h:13
Definition ResolvedItemIconInfo.h:8