LeviLamina
Loading...
Searching...
No Matches
VillageFeature.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#ifdef LL_PLAT_S
5#include "mc/common/BiomeIdType.h"
6#include "mc/world/level/biome/Biome.h"
7#include "mc/world/level/biome/registry/BiomeRegistry.h"
8#include "mc/world/level/levelgen/structure/VanillaStructureFeatureType.h"
9#endif
10
11// auto generated inclusion list
12#include "mc/world/level/levelgen/structure/StructureFeature.h"
13
14// auto generated forward declare list
15// clang-format off
16class BiomeRegistry;
17class BiomeSource;
18class BlockPos;
19class ChunkPos;
20class Dimension;
21class HashedString;
23class Random;
24class StructureStart;
25struct BiomeIdType;
26// clang-format on
27
28class VillageFeature : public ::StructureFeature {
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<4, 4, int> mTownSpacing;
33 ::ll::TypedStorage<4, 4, int> mMinTownSeparation;
34 ::ll::TypedStorage<8, 24, ::std::vector<::BiomeIdType>> mAllowedBiomes;
35 // NOLINTEND
36
37#ifdef LL_PLAT_S
38 VillageFeature(uint seed, int townSpacing, int minTownSeparation, BiomeRegistry const& biomeRegistry)
39 : StructureFeature(seed, VanillaStructureFeatureType::Village()),
40 mTownSpacing(townSpacing),
41 mMinTownSeparation(minTownSeparation) {
42 mAllowedBiomes->clear();
43 mRadius = 4;
44
45 for (auto const& biome : biomeRegistry.mBiomesById.get()) {
46 if (biome.get() != biomeRegistry.mEmptyBiome) {
47 mAllowedBiomes->push_back(biome->mId);
48 }
49 }
50 }
51#else // LL_PLAT_C
52public:
53 // prevent constructor by default
54 VillageFeature();
55
56#endif
57public:
58 // virtual functions
59 // NOLINTBEGIN
60 virtual ::gsl::span<::BiomeIdType const> getRequiredBiomes() const /*override*/;
61
62 virtual bool isFeatureChunk(
63 ::BiomeSource const& biomeSource,
64 ::Random& random,
65 ::ChunkPos const& chunkPos,
66 uint levelSeed,
67 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel,
68 ::Dimension const&
69 ) /*override*/;
70
71 virtual bool getNearestGeneratedFeature(
72 ::Dimension& dimension,
73 ::BiomeSource const& biomeSource,
74 ::BlockPos const& origin,
75 ::BlockPos& pos,
76 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel,
77 bool mustBeInNewChunks,
78 ::std::optional<::HashedString> const& biomeTag
79 ) /*override*/;
80
81 virtual bool shouldPostProcessMobs() const /*override*/;
82
83 virtual ::std::unique_ptr<::StructureStart> createStructureStart(
84 ::Dimension& generator,
85 ::BiomeSource const& biomeSource,
86 ::Random& random,
87 ::ChunkPos const& chunkPos,
88 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel
89 ) /*override*/;
90
91 virtual ~VillageFeature() /*override*/ = default;
92 // NOLINTEND
93
94public:
95 // member functions
96 // NOLINTBEGIN
97#ifdef LL_PLAT_C
98 MCAPI VillageFeature(uint seed, int townSpacing, int minTownSeparation, ::BiomeRegistry const& biomeRegistry);
99#endif
100 // NOLINTEND
101
102public:
103 // constructor thunks
104 // NOLINTBEGIN
105#ifdef LL_PLAT_C
106 MCAPI void* $ctor(uint seed, int townSpacing, int minTownSeparation, ::BiomeRegistry const& biomeRegistry);
107#endif
108 // NOLINTEND
109
110public:
111 // virtual function thunks
112 // NOLINTBEGIN
113 MCFOLD ::gsl::span<::BiomeIdType const> $getRequiredBiomes() const;
114
115 MCAPI bool $isFeatureChunk(
116 ::BiomeSource const& biomeSource,
117 ::Random& random,
118 ::ChunkPos const& chunkPos,
119 uint levelSeed,
120 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel,
121 ::Dimension const&
122 );
123
124 MCAPI bool $getNearestGeneratedFeature(
125 ::Dimension& dimension,
126 ::BiomeSource const& biomeSource,
127 ::BlockPos const& origin,
128 ::BlockPos& pos,
129 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel,
130 bool mustBeInNewChunks,
131 ::std::optional<::HashedString> const& biomeTag
132 );
133
134 MCFOLD bool $shouldPostProcessMobs() const;
135
136 MCAPI ::std::unique_ptr<::StructureStart> $createStructureStart(
137 ::Dimension& generator,
138 ::BiomeSource const& biomeSource,
139 ::Random& random,
140 ::ChunkPos const& chunkPos,
141 ::IPreliminarySurfaceProvider const& preliminarySurfaceLevel
142 );
143
144
145 // NOLINTEND
146
147public:
148 // vftables
149 // NOLINTBEGIN
150 MCNAPI static void** $vftable();
151 // NOLINTEND
152};
Definition BiomeRegistry.h:38
Definition BiomeSource.h:23
Definition BlockPos.h:19
Definition ChunkPos.h:11
Definition Dimension.h:86
Definition HashedString.h:5
Definition IPreliminarySurfaceProvider.h:8
Definition Random.h:10
Definition StructureStart.h:15
static MCAPI void ** $vftable()
Definition BiomeIdType.h:8