LeviLamina
Loading...
Searching...
No Matches
BlockPalette.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/core/utility/buffer_span.h"
8#include "mc/platform/threading/Mutex.h"
9
10// auto generated forward declare list
11// clang-format off
12class Block;
13class BlockType;
15class Level;
16struct BlockID;
17struct NewBlockID;
18struct NibblePair;
19// clang-format on
20
21class BlockPalette {
22public:
23 // BlockPalette inner types declare
24 // clang-format off
25 struct ConstructorToken;
26 // clang-format on
27
28 // BlockPalette inner types define
29 enum class PaletteType : int {
30 Sequential = 0,
31 Hashed = 1,
32 };
33
35
36public:
37 // member variables
38 // NOLINTBEGIN
39 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mBlockTypeStatesConversionWarningMutex;
40 ::ll::TypedStorage<8, 16, ::std::set<::std::pair<int, int>>> mBlockTypeStatesConversionWarningSet;
41 ::ll::TypedStorage<8, 24, ::std::vector<::Block const*>> mBlockFromNetworkId;
42 ::ll::TypedStorage<8, 8, ::Level*> mLevel;
43 // NOLINTEND
44
45public:
46 // prevent constructor by default
47 BlockPalette();
48
49public:
50 // virtual functions
51 // NOLINTBEGIN
52 virtual ~BlockPalette();
53
54 virtual ::BlockPalette::PaletteType getPaletteType();
55
56 virtual void appendBlock(::Block const& blockState);
57
58 virtual ::Block const& getBlock(uint const& networkId) const;
59
60 virtual void assignBlockNetworkId(::Block const& block, uint64 networkId) const;
61 // NOLINTEND
62
63public:
64 // member functions
65 // NOLINTBEGIN
66 MCAPI explicit BlockPalette(::BlockPalette::ConstructorToken);
67
68 MCAPI explicit BlockPalette(::Level& level);
69
70 MCAPI void cacheBlockComponentData();
71
72 MCAPI ::Block const& getBlockFromLegacyData(::NewBlockID id, uint data) const;
73
74 MCAPI ::Bedrock::NonOwnerPointer<::IUnknownBlockTypeRegistry> const getUnknownBlockTypeRegistry() const;
75
76 MCAPI void initFromBlockDefinitions();
77
78 MCAPI bool shouldWarnFor(::NewBlockID id, ushort data) const;
79
80 MCAPI ::Block const& switchBlock(::Block const& oldBlock, ::BlockType const& newBlockType) const;
81 // NOLINTEND
82
83public:
84 // static functions
85 // NOLINTBEGIN
86 MCAPI static ::Block const& convertLegacyBlock(::BlockID id, ushort data);
87
88 MCAPI static bool convertLegacyBlocks(
92 uint64 volume
93 );
94 // NOLINTEND
95
96public:
97 // constructor thunks
98 // NOLINTBEGIN
99 MCAPI void* $ctor(::BlockPalette::ConstructorToken);
100
101 MCAPI void* $ctor(::Level& level);
102 // NOLINTEND
103
104public:
105 // destructor thunk
106 // NOLINTBEGIN
107 MCAPI void $dtor();
108 // NOLINTEND
109
110public:
111 // virtual function thunks
112 // NOLINTBEGIN
113 MCFOLD ::BlockPalette::PaletteType $getPaletteType();
114
115 MCAPI void $appendBlock(::Block const& blockState);
116
117 MCAPI ::Block const& $getBlock(uint const& networkId) const;
118
119 MCAPI void $assignBlockNetworkId(::Block const& block, uint64 networkId) const;
120
121
122 // NOLINTEND
123
124public:
125 // vftables
126 // NOLINTBEGIN
127 MCAPI static void** $vftable();
128 // NOLINTEND
129};
Definition BlockType.h:84
Definition Block.h:69
Definition IUnknownBlockTypeRegistry.h:14
Definition Level.h:255
Definition _HeaderOutputPredefine.h:309
Definition buffer_span.h:6
Definition BlockID.h:8
Definition BlockPalette.h:34
Definition NewBlockID.h:8
Definition NibblePair.h:5