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/buffer_span.h"
7
8// auto generated forward declare list
9// clang-format off
10class Block;
11class BlockType;
12class Level;
13struct BlockID;
14struct NewBlockID;
15struct NibblePair;
16// clang-format on
17
18class BlockPalette {
19public:
20 // BlockPalette inner types declare
21 // clang-format off
22 struct ConstructorToken;
23 // clang-format on
24
25 // BlockPalette inner types define
26 enum class PaletteType : int {
27 Sequential = 0,
28 Hashed = 1,
29 };
30
32
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 80, ::std::mutex> mLegacyBlockStatesConversionWarningMutex;
37 ::ll::TypedStorage<8, 16, ::std::set<::std::pair<int, int>>> mLegacyBlockStatesConversionWarningSet;
38 ::ll::TypedStorage<8, 24, ::std::vector<::Block const*>> mBlockFromNetworkId;
39 ::ll::TypedStorage<8, 8, ::Level*> mLevel;
40 // NOLINTEND
41
42public:
45
46public:
47 // prevent constructor by default
48 BlockPalette();
49
50public:
51 // virtual functions
52 // NOLINTBEGIN
53 virtual ~BlockPalette();
54
55 virtual ::BlockPalette::PaletteType getPaletteType();
56
57 virtual void appendBlock(::Block const& blockState);
58
59 virtual ::Block const& getBlock(uint const& networkId) const;
60
61 virtual void assignBlockNetworkId(::Block const& block, uint64 networkId) const;
62 // NOLINTEND
63
64public:
65 // member functions
66 // NOLINTBEGIN
67 MCAPI explicit BlockPalette(::Level& level);
68
69 MCAPI void cacheBlockComponentData();
70
71 MCAPI ::Block const& getBlockFromLegacyData(::NewBlockID id, uint data) const;
72
73 MCAPI bool shouldWarnFor(::NewBlockID id, ushort data) const;
74
75 MCAPI ::Block const& switchBlock(::Block const& oldBlock, ::BlockType const& newBlockType) const;
76 // NOLINTEND
77
78public:
79 // static functions
80 // NOLINTBEGIN
81 MCAPI static ::Block const& convertLegacyBlock(::BlockID id, ushort data);
82
83 MCAPI static bool convertLegacyBlocks(
87 uint64 volume
88 );
89 // NOLINTEND
90
91public:
92 // constructor thunks
93 // NOLINTBEGIN
94 MCAPI void* $ctor(::Level& level);
95 // NOLINTEND
96
97public:
98 // destructor thunk
99 // NOLINTBEGIN
100 MCAPI void $dtor();
101 // NOLINTEND
102
103public:
104 // virtual function thunks
105 // NOLINTBEGIN
106 MCFOLD ::BlockPalette::PaletteType $getPaletteType();
107
108 MCAPI void $appendBlock(::Block const& blockState);
109
110 MCAPI ::Block const& $getBlock(uint const& networkId) const;
111
112 MCAPI void $assignBlockNetworkId(::Block const& block, uint64 networkId) const;
113
114
115 // NOLINTEND
116
117public:
118 // vftables
119 // NOLINTBEGIN
120 MCAPI static void** $vftable();
121 // NOLINTEND
122};
LLAPI void initFromBlockDefinitions()
Walks every registered block type and appends each of its permutations to this palette.
Definition BlockType.h:79
Definition Block.h:41
Definition Level.h:254
Definition _HeaderOutputPredefine.h:343
Definition buffer_span.h:6
Definition BlockID.h:8
Definition BlockPalette.h:31
Definition NewBlockID.h:8
Definition NibblePair.h:5