LeviLamina
Loading...
Searching...
No Matches
MobSpawnRules.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/shared_types/legacy/Difficulty.h"
7#include "mc/world/level/block/BlockDescriptor.h"
8
9// auto generated forward declare list
10// clang-format off
11class BlockSource;
12class IRandom;
13class MobSpawnerData;
15class Random;
16class SpawnConditions;
18struct MobSpawnHerdInfo;
19// clang-format on
20
21class MobSpawnRules {
22public:
23 // MobSpawnRules inner types define
24 using OnGetSpawnCountCallback =
25 ::std::function<int(::SpawnConditions const&, ::BlockSource&, ::Random&, ::MobSpawnerData const&)>;
26
27public:
28 // member variables
29 // NOLINTBEGIN
30 ::ll::TypedStorage<8, 64, ::std::function<bool(::SpawnConditions const&, ::BlockSource&)>> mHardcodedCallbackRule;
31 ::ll::TypedStorage<4, 4, int> mMinBrightness;
32 ::ll::TypedStorage<4, 4, int> mMaxBrightness;
33 ::ll::TypedStorage<4, 4, float> mMinMoonBrightness;
34 ::ll::TypedStorage<4, 4, float> mMaxMoonBrightness;
35 ::ll::TypedStorage<1, 1, bool> mAdjustForWeather;
36 ::ll::TypedStorage<4, 4, int> mMinHeight;
37 ::ll::TypedStorage<4, 4, int> mMaxHeight;
38 ::ll::TypedStorage<4, 4, int> mRarity;
39 ::ll::TypedStorage<4, 4, int> mSurfaceCap;
40 ::ll::TypedStorage<4, 4, int> mUndergroundCap;
41 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::Difficulty> mMinDifficulty;
42 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::Difficulty> mMaxDifficulty;
43 ::ll::TypedStorage<4, 4, int> mMinSpawnDistance;
44 ::ll::TypedStorage<4, 4, int> mMaxSpawnDistance;
45 ::ll::TypedStorage<4, 4, int> mSpawnDistanceCap;
46 ::ll::TypedStorage<1, 1, bool> mSurfaceSpawner;
47 ::ll::TypedStorage<1, 1, bool> mUndergroundSpawner;
48 ::ll::TypedStorage<1, 1, bool> mWaterSpawner;
49 ::ll::TypedStorage<1, 1, bool> mBubbleSpawner;
50 ::ll::TypedStorage<1, 1, bool> mLavaSpawner;
51 ::ll::TypedStorage<4, 4, uint> mPlayerInVillageDistance;
52 ::ll::TypedStorage<4, 4, uint> mPlayerInVillageBorderTolerance;
53 ::ll::TypedStorage<1, 1, bool> mExperimentalSpawner;
54 ::ll::TypedStorage<8, 8, uint64> mMinWorldAge;
55 ::ll::TypedStorage<8, 8, uint64> mMaxWorldAge;
56 ::ll::TypedStorage<4, 4, int> mMinDelay;
57 ::ll::TypedStorage<4, 4, int> mMaxDelay;
58 ::ll::TypedStorage<8, 24, ::std::vector<::MobSpawnHerdInfo>> mHerdList;
59 ::ll::TypedStorage<8, 24, ::std::vector<::MobSpawnerPermutation>> mPermutationList;
60 ::ll::TypedStorage<8, 32, ::std::string> mMobEventName;
61 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mSpawnOnBlockList;
62 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mSpawnAboveBlockList;
63 ::ll::TypedStorage<8, 24, ::std::vector<::BlockDescriptor>> mSpawnOnBlockPreventedList;
64 ::ll::TypedStorage<4, 4, int> mAboveBlockDistance;
65 ::ll::TypedStorage<8, 24, ::std::vector<::MobSpawnerPermutation>> mGuaranteedList;
66 ::ll::TypedStorage<8, 32, ::std::string> mMobToDelayId;
67 ::ll::TypedStorage<4, 4, int> mDelaySpawnChance;
68 ::ll::TypedStorage<1, 1, bool> mPersistence;
69 // NOLINTEND
70
71public:
72 // member functions
73 // NOLINTBEGIN
74 MCAPI MobSpawnRules();
75
76 MCAPI MobSpawnRules(::MobSpawnRules&&);
77
78 MCAPI MobSpawnRules(::MobSpawnRules const&);
79
80 MCAPI ::MobSpawnRules& addPermutation(int weight, int guaranteedCount, ::ActorDefinitionIdentifier const& id);
81
82 MCAPI bool canSpawnInConditions(::SpawnConditions const& conditions, ::BlockSource& region) const;
83
84 MCFOLD int getAboveBlockDistance() const;
85
86 MCAPI ::std::pair<int, int> const getDelayRange() const;
87
88 MCFOLD int getDelaySpawnChance() const;
89
90 MCFOLD ::std::vector<::MobSpawnerPermutation> const& getGuaranteedPermutations() const;
91
92 MCFOLD ::std::vector<::MobSpawnHerdInfo>& getHerdListMutable();
93
94 MCAPI ::std::string const getMobToDelayId() const;
95
96 MCFOLD ::std::vector<::MobSpawnerPermutation> const& getPermutations() const;
97
98 MCAPI bool getPersistence() const;
99
100 MCAPI int getPopulationCap(::SpawnConditions const& conditions) const;
101
102 MCFOLD ::std::vector<::BlockDescriptor> const& getSpawnAboveBlockList() const;
103
104 MCFOLD ::std::vector<::BlockDescriptor>& getSpawnAboveBlockListMutable();
105
106 MCAPI int getSpawnCount(
107 ::SpawnConditions const& conditions,
108 ::BlockSource& region,
109 ::Random& random,
110 ::MobSpawnHerdInfo const& herdInfo
111 ) const;
112
113 MCFOLD ::std::vector<::BlockDescriptor> const& getSpawnOnBlockList() const;
114
115 MCFOLD ::std::vector<::BlockDescriptor>& getSpawnOnBlockListMutable();
116
117 MCFOLD ::std::vector<::BlockDescriptor> const& getSpawnOnBlockPreventedList() const;
118
119 MCFOLD ::std::vector<::BlockDescriptor>& getSpawnOnBlockPreventedListMutable();
120
121 MCFOLD bool isLavaSpawner() const;
122
123 MCFOLD bool isUnderwaterSpawner() const;
124
125 MCAPI ::MobSpawnRules& operator=(::MobSpawnRules&&);
126
127 MCAPI ::MobSpawnRules& operator=(::MobSpawnRules const&);
128
129 MCAPI ::MobSpawnHerdInfo const& selectRandomHerd(::IRandom& random) const;
130
131 MCAPI ::MobSpawnRules& setAboveBlockDistance(int distance);
132
133 MCAPI ::MobSpawnRules& setBrightnessRange(int minBrightness, int maxBrightness, bool adjustForWeather);
134
135 MCAPI ::MobSpawnRules& setBubbleSpawner(bool isBubbleSpawner);
136
137 MCAPI ::MobSpawnRules& setDelayRange(int min, int max, ::std::string const& id);
138
139 MCFOLD ::MobSpawnRules& setDelaySpawnChance(int chance);
140
141 MCAPI ::MobSpawnRules& setDifficultyRange(
142 ::SharedTypes::Legacy::Difficulty minDifficulty,
143 ::SharedTypes::Legacy::Difficulty maxDifficulty
144 );
145
146 MCAPI ::MobSpawnRules& setExperimentalGameplay();
147
148 MCAPI ::MobSpawnRules&
149 setHardcodedSpawnRuleCallback(::std::function<bool(::SpawnConditions const&, ::BlockSource&)> callback);
150
151 MCAPI ::MobSpawnRules& setHeightRange(int minHeight, int maxHeight);
152
153 MCAPI ::MobSpawnRules& setLavaSpawner();
154
155 MCAPI ::MobSpawnRules& setMobEventType(::std::string const& eventName);
156
157 MCAPI ::MobSpawnRules& setPersistence(bool persistence);
158
159 MCFOLD ::MobSpawnRules& setPlayerInVillageBorderTolerance(uint tolerance);
160
161 MCAPI ::MobSpawnRules& setPlayerInVillageDistance(uint distance);
162
163 MCAPI ::MobSpawnRules& setPopulationCap(int surfaceCap, int undergroundCap);
164
165 MCAPI ::MobSpawnRules& setRarity(int rarity);
166
167 MCAPI ::MobSpawnRules& setSpawnDistanceCap(int max);
168
169 MCAPI ::MobSpawnRules& setSpawnDistances(int min, int max);
170
171 MCAPI ::MobSpawnRules& setSurfaceSpawner();
172
173 MCAPI ::MobSpawnRules& setUndergroundSpawner();
174
175 MCAPI ::MobSpawnRules& setUnderwaterSpawner();
176
177 MCAPI ::MobSpawnRules& setWorldAgeRange(uint64 min, uint64 max);
178
179 MCAPI ~MobSpawnRules();
180 // NOLINTEND
181
182public:
183 // static variables
184 // NOLINTBEGIN
185 MCAPI static int const& LOW_END_MAX_SPAWN_DISTANCE();
186
187 MCAPI static int const& MAX_DEFAULT_SPAWN_DISTANCE();
188
189 MCAPI static uint64 const& MAX_WORLD_AGE();
190
191 MCAPI static int const& MIN_DEFAULT_SPAWN_DISTANCE();
192 // NOLINTEND
193
194public:
195 // constructor thunks
196 // NOLINTBEGIN
197 MCAPI void* $ctor();
198
199 MCAPI void* $ctor(::MobSpawnRules&&);
200
201 MCAPI void* $ctor(::MobSpawnRules const&);
202 // NOLINTEND
203
204public:
205 // destructor thunk
206 // NOLINTBEGIN
207 MCAPI void $dtor();
208 // NOLINTEND
209};
Definition BlockSource.h:73
Definition IRandom.h:10
Definition MobSpawnerData.h:17
Definition MobSpawnerPermutation.h:9
Definition Random.h:10
Definition SpawnConditions.h:13
Definition ActorDefinitionIdentifier.h:15
Definition MobSpawnHerdInfo.h:5