Skip to content
LeviLamina
Loading...
Searching...
No Matches
LegacyChunkStorage.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/world/level/ChunkPos.h"
8#include "mc/world/level/chunk/ChunkSource.h"
9#include "mc/world/level/levelgen/synth/PerlinSimplexNoise.h"
10#include "mc/world/level/storage/StorageVersion.h"
11
12// auto generated forward declare list
13// clang-format off
14class Biome;
15class LevelChunk;
16class LevelStorage;
17class RegionFile;
19// clang-format on
20
21class LegacyChunkStorage : public ::ChunkSource {
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<1, 1, bool> mDone;
26 ::ll::TypedStorage<8, 40, ::PerlinSimplexNoise const> mGrassNoise;
27 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string> const> mLevelPath;
28 ::ll::TypedStorage<8, 32, ::Core::PathBuffer<::std::string> const> mImportedChunksPath;
29 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RegionFile>> mRegionFile;
30 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::RegionFile>> mEntitiesFile;
31 ::ll::TypedStorage<4, 4, ::StorageVersion> mLoadedStorageVersion;
32 ::ll::TypedStorage<8, 8, ::Biome&> mDefaultBiome;
33 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::string>> mChunkEntities;
34 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ChunkPos, ::std::string>> mChunkBlockEntities;
35 ::ll::TypedStorage<8, 80, ::std::mutex> mRegionFileMutex;
36 ::ll::TypedStorage<8, 80, ::std::mutex> mChunkMapMutex;
37 // NOLINTEND
38
39public:
40 // prevent constructor by default
41 LegacyChunkStorage& operator=(LegacyChunkStorage const&);
42 LegacyChunkStorage(LegacyChunkStorage const&);
43 LegacyChunkStorage();
44
45public:
46 // virtual functions
47 // NOLINTBEGIN
48 virtual ~LegacyChunkStorage() /*override*/ = default;
49
50 virtual void loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad) /*override*/;
51
52 virtual bool saveLiveChunk(::LevelChunk& lc) /*override*/;
53
54 virtual void acquireDiscarded(::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter> ptr) /*override*/;
55 // NOLINTEND
56
57public:
58 // member functions
59 // NOLINTBEGIN
60 MCAPI LegacyChunkStorage(
61 ::std::unique_ptr<::ChunkSource> parent,
62 ::LevelStorage& levelStorage,
63 ::StorageVersion v,
64 ::Biome& defaultBiome
65 );
66
67 MCAPI void _markChunkAsImported(::ChunkPos const& pos);
68 // NOLINTEND
69
70public:
71 // constructor thunks
72 // NOLINTBEGIN
73 MCAPI void* $ctor(
74 ::std::unique_ptr<::ChunkSource> parent,
75 ::LevelStorage& levelStorage,
76 ::StorageVersion v,
77 ::Biome& defaultBiome
78 );
79 // NOLINTEND
80
81public:
82 // virtual function thunks
83 // NOLINTBEGIN
84 MCAPI void $loadChunk(::LevelChunk& lc, bool forceImmediateReplacementDataLoad);
85
86 MCAPI bool $saveLiveChunk(::LevelChunk& lc);
87
88 MCAPI void $acquireDiscarded(::std::unique_ptr<::LevelChunk, ::LevelChunkFinalDeleter> ptr);
89
90
91 // NOLINTEND
92};
Definition Biome.h:23
Definition ChunkPos.h:13
Definition LevelChunk.h:77
Definition LevelStorage.h:25
Definition RegionFile.h:15
Definition LevelChunkFinalDeleter.h:5