Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ChunkViewSource.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/threading/SharedLockbox.h"
7#include "mc/util/GridArea.h"
8#include "mc/world/level/chunk/ChunkSource.h"
9#include "mc/world/level/chunk/ChunkSourceViewGenerateMode.h"
10
11// auto generated forward declare list
12// clang-format off
13class BlockPos;
14class ChunkPos;
15class LevelChunk;
16class Random;
17struct Bounds;
19namespace br::worldgen { class StructureInstance; }
20namespace br::worldgen { struct Structure; }
21// clang-format on
22
23class ChunkViewSource : public ::ChunkSource {
24public:
25 // member variables
26 // NOLINTBEGIN
27 ::ll::TypedStorage<4, 4, ::ChunkSource::LoadMode> mParentLoadMode;
28 ::ll::TypedStorage<8, 304, ::GridArea<::std::shared_ptr<::LevelChunk>, ::Bedrock::Threading::SharedLockbox>> mArea;
29 ::ll::TypedStorage<8, 8, ::ChunkSource&> mMainSource;
30 // NOLINTEND
31
32public:
33 // prevent constructor by default
34 ChunkViewSource& operator=(ChunkViewSource const&);
35 ChunkViewSource();
36
37public:
38 // virtual functions
39 // NOLINTBEGIN
40 virtual ::std::shared_ptr<::LevelChunk> getExistingChunk(::ChunkPos const& pos) /*override*/;
41
42 virtual ::std::shared_ptr<::LevelChunk> getRandomChunk(::Random& random) /*override*/;
43
44 virtual void acquireDiscarded(::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter> ptr) /*override*/;
45
46 virtual ::std::shared_ptr<::LevelChunk>
47 createNewChunk(::ChunkPos const& cp, ::ChunkSource::LoadMode lm, bool readOnly) /*override*/;
48
49 virtual bool isWithinWorldLimit(::ChunkPos const& cp) const /*override*/;
50
51 virtual void setLevelChunk(::std::shared_ptr<::LevelChunk> lc) /*override*/;
52
53 virtual ::std::shared_ptr<::br::worldgen::StructureInstance>
54 _tryGetOrLoadStructureInstanceAt(::ChunkPos const& cp, ::br::worldgen::Structure const& structure) /*override*/;
55
56 virtual ~ChunkViewSource() /*override*/;
57 // NOLINTEND
58
59public:
60 // member functions
61 // NOLINTBEGIN
62 MCAPI ChunkViewSource(::ChunkViewSource const& otherChunkViewSource);
63
64 MCNAPI void move(
65 ::Bounds const& bounds,
66 bool isCircle,
67 ::ChunkSourceViewGenerateMode chunkViewGenerateMode,
68 ::std::function<void(::gsl::span<::std::shared_ptr<::LevelChunk>>)> add,
69 float const* serverBuildRatio
70 );
71
72 MCAPI void move(
73 ::BlockPos const& blockMin,
74 ::BlockPos const& blockMax,
75 bool isCircle,
76 ::ChunkSourceViewGenerateMode chunkViewGenerateMode,
77 ::std::function<void(::gsl::span<::std::shared_ptr<::LevelChunk>>)> add,
78 float const* serverBuildRatio
79 );
80
81 MCNAPI void move(
82 ::BlockPos const& center,
83 int radius,
84 bool isCircle,
85 ::ChunkSourceViewGenerateMode chunkViewGenerateMode,
86 ::std::function<void(::gsl::span<::std::shared_ptr<::LevelChunk>>)> add,
87 float const* serverBuildRatio
88 );
89
91 ::Bounds const& bounds,
92 bool,
93 ::std::function<void(::gsl::span<::std::shared_ptr<::LevelChunk>>)>
94 );
95 // NOLINTEND
96
97public:
98 // constructor thunks
99 // NOLINTBEGIN
100 MCAPI void* $ctor(::ChunkViewSource const& otherChunkViewSource);
101 // NOLINTEND
102
103public:
104 // destructor thunk
105 // NOLINTBEGIN
106 MCAPI void $dtor();
107 // NOLINTEND
108
109public:
110 // virtual function thunks
111 // NOLINTBEGIN
112 MCAPI ::std::shared_ptr<::LevelChunk> $getExistingChunk(::ChunkPos const& pos);
113
114 MCAPI ::std::shared_ptr<::LevelChunk> $getRandomChunk(::Random& random);
115
116 MCAPI void $acquireDiscarded(::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter> ptr);
117
118 MCNAPI ::std::shared_ptr<::LevelChunk>
119 $createNewChunk(::ChunkPos const& cp, ::ChunkSource::LoadMode lm, bool readOnly);
120
121 MCAPI bool $isWithinWorldLimit(::ChunkPos const& cp) const;
122
123 MCAPI void $setLevelChunk(::std::shared_ptr<::LevelChunk> lc);
124
125 MCAPI ::std::shared_ptr<::br::worldgen::StructureInstance>
126 $_tryGetOrLoadStructureInstanceAt(::ChunkPos const& cp, ::br::worldgen::Structure const& structure);
127
128
129 // NOLINTEND
130
131public:
132 // vftables
133 // NOLINTBEGIN
134 MCNAPI static void** $vftable();
135 // NOLINTEND
136};
Definition SharedLockbox.h:9
Definition BlockPos.h:14
Definition ChunkPos.h:13
MCAPI void move(::Bounds const &bounds, bool isCircle, ::ChunkSourceViewGenerateMode chunkViewGenerateMode, ::std::function< void(::gsl::span<::std::shared_ptr<::LevelChunk > >)> add, float const *serverBuildRatio)
static MCAPI void ** $vftable()
MCAPI ::std::shared_ptr<::LevelChunk > $createNewChunk(::ChunkPos const &cp, ::ChunkSource::LoadMode lm, bool readOnly)
MCAPI void move(::BlockPos const &center, int radius, bool isCircle, ::ChunkSourceViewGenerateMode chunkViewGenerateMode, ::std::function< void(::gsl::span<::std::shared_ptr<::LevelChunk > >)> add, float const *serverBuildRatio)
MCAPI void rebuildSpecificArea(::Bounds const &bounds, bool, ::std::function< void(::gsl::span<::std::shared_ptr<::LevelChunk > >)>)
Definition LevelChunk.h:76
Definition Random.h:10
Definition StructureInstance.h:20
Definition Bounds.h:8
Definition LevelChunkFinalDeleter.h:5
Definition Structure.h:24