Skip to content

Commit bc4c49e

Browse files
committed
feat: adapt to LeviLamina 1.6.0
1 parent 3b52b22 commit bc4c49e

23 files changed

+233
-488
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.11.0] - 2025-10-10
11+
12+
### Changed
13+
14+
- Adapt to LeviLamina 1.6.0(BDS-1.21.111.1)
15+
1016
## [0.10.1] - 2025-10-04
1117

1218
### Changed
@@ -114,7 +120,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
114120

115121
- Release the first version
116122

117-
[Unreleased]: https://github.com/LiteLDev/MoreDimensions/compare/v0.10.1...HEAD
123+
[Unreleased]: https://github.com/LiteLDev/MoreDimensions/compare/v0.11.0...HEAD
124+
[0.11.0]: https://github.com/LiteLDev/MoreDimensions/compare/v0.10.1...v0.11.0
118125
[0.10.1]: https://github.com/LiteLDev/MoreDimensions/compare/v0.9.0...v0.10.1
119126
[0.9.0]: https://github.com/LiteLDev/MoreDimensions/compare/v0.8.0...v0.9.0
120127
[0.8.0]: https://github.com/LiteLDev/MoreDimensions/compare/v0.7.0...v0.8.0

src/more_dimensions/api/dimension/CustomDimensionManager.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "ll/api/memory/Hook.h"
1212
#include "ll/api/service/Bedrock.h"
1313
#include "ll/api/utils/Base64Utils.h"
14-
#include "ll/api/utils/StringUtils.h"
1514

1615
#include "mc/deps/core/math/Vec3.h"
1716
#include "mc/nbt/Tag.h"
@@ -24,7 +23,6 @@
2423
#include "mc/world/level/dimension/VanillaDimensions.h"
2524
#include "mc/world/level/storage/LevelStorage.h"
2625

27-
2826
class Scheduler;
2927

3028
namespace more_dimensions {
@@ -81,13 +79,13 @@ LL_TYPE_STATIC_HOOK(
8179
HookPriority::Normal,
8280
VanillaDimensions,
8381
VanillaDimensions::fromSerializedInt,
84-
DimensionType,
85-
int dimId
82+
::Bedrock::Result<::DimensionType>,
83+
::Bedrock::Result<int>&& i
8684
) {
87-
if (!VanillaDimensions::DimensionMap().mLeft.contains(dimId)) {
85+
if (!VanillaDimensions::DimensionMap().mLeft.contains(i.value())) {
8886
return VanillaDimensions::Undefined();
8987
}
90-
return {dimId};
88+
return {i};
9189
}
9290

9391
// inline function use patch

src/more_dimensions/api/dimension/SimpleCustomDimension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ namespace more_dimensions {
4848
namespace {
4949
using namespace ll::memory_literals;
5050

51-
DWORD overworld_addStructureFeatures_rva = 0x047B350;
52-
DWORD nethrer_addStructureFeatures_rva = 0x0479FC0;
51+
DWORD overworld_addStructureFeatures_rva = 0x04ED250;
52+
DWORD nethrer_addStructureFeatures_rva = 0x04EBEE0;
5353

5454
// static auto* overworldAddress =
5555
// "`anonymous namespace'::unity_5c986e6b9d6571cc96912b0bfa0329e2::addStructureFeatures"_symp;

src/more_dimensions/core/dimension/FakeDimensionId.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "mc/deps/core/math/Vec3.h"
1010
#include "mc/deps/core/utility/BinaryStream.h"
11-
#include "mc/deps/ecs/gamerefs_entity/EntityContext.h"
1211
#include "mc/entity/components/IPlayerTickPolicy.h"
1312
#include "mc/entity/components/MovementPackets.h"
1413
#include "mc/entity/components/ServerPlayerMovementComponent.h"
@@ -34,18 +33,23 @@
3433
#include "mc/network/packet/SubChunkRequestPacket.h"
3534
#include "mc/network/packet/UpdateBlockPacket.h"
3635
#include "mc/server/ServerPlayer.h"
37-
#include "mc/util/MolangVariableMap.h"
36+
#include "mc/util/MolangVariable.h"
3837
#include "mc/util/VarIntDataOutput.h"
39-
#include "mc/world/actor/ActorDataIDs.h"
40-
#include "mc/world/actor/SynchedActorDataEntityWrapper.h"
4138
#include "mc/world/level/ChangeDimensionRequest.h"
42-
#include "mc/world/level/ChunkPos.h"
4339
#include "mc/world/level/Level.h"
4440
#include "mc/world/level/LoadingScreenIdManager.h"
4541
#include "mc/world/level/SpawnSettings.h"
4642
#include "mc/world/level/dimension/VanillaDimensions.h"
47-
#include "mc/world/level/levelSettings.h"
4843

44+
// From https://github.com/OEOTYAN/BedrockServerClientInterface/blob/6f74e2d00e574ea24cdac76238d7d67310586eec/src/bsci/particle/ParticleSpawner.cpp#L41
45+
MolangVariableMap::MolangVariableMap(MolangVariableMap const& rhs) {
46+
mMapFromVariableIndexToVariableArrayOffset = rhs.mMapFromVariableIndexToVariableArrayOffset;
47+
mVariables = {};
48+
for (auto& ptr : *rhs.mVariables) {
49+
mVariables->push_back(std::make_unique<MolangVariable>(*ptr));
50+
}
51+
mHasPublicVariables = rhs.mHasPublicVariables;
52+
}
4953

5054
// ChangeDimensionPacket.java
5155
// ClientboundMapItemDataPacket.java
@@ -334,15 +338,12 @@ LL_TYPE_INSTANCE_HOOK(
334338
SpawnParticleEffectPacket,
335339
&SpawnParticleEffectPacket::$ctor,
336340
void*,
337-
Vec3 const& pos,
338-
std::string const& particle_name,
339-
uchar dimId,
340-
std::optional<MolangVariableMap> molang
341+
::SpawnParticleEffectPacketPayload payload
341342
) {
342-
if (dimId >= 3) {
343-
dimId = FakeDimensionId::fakeDim.id;
343+
if (mVanillaDimensionId >= 3) {
344+
mVanillaDimensionId = FakeDimensionId::fakeDim.id;
344345
}
345-
return origin(pos, particle_name, dimId, std::move(molang));
346+
return origin(std::move(payload));
346347
}
347348

348349
} // namespace sendpackethook

src/more_dimensions/core/dimension/MoreDimensionsPatch.h

Lines changed: 48 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,54 @@ struct AddressAndReg {
1616

1717
// VanillaDimensions::toSerializedInt and VanillaDimensions::fromSerializedInt(int)
1818
std::vector<AddressAndReg> data = {
19-
{0x0888530, 0x088880f, 0x088883a, {0x89, 0xc8} },
20-
{0x090ccb0, 0x090cdbf, 0x090cde2, {0x89, 0xcb} },
21-
{0x090cfd0, 0x090d0ee, 0x090d111, {0x89, 0xcb} },
22-
{0x090d300, 0x090d41c, 0x090d43f, {0x89, 0xcb} },
23-
{0x0913c50, 0x0913fce, 0x0913ff1, {0x89, 0xc3} },
24-
{0x0d8d360, 0x0d8d610, 0x0d8d63a, {0x89, 0x4e, 0x3c} },
25-
{0x0dc8f90, 0x0dc91f7, 0x0dc9213, {0x89, 0xcf} },
26-
{0x0dc9480, 0x0dc9a72, 0x0dc9a9b, {0x89, 0xc3} },
27-
{0x124a2e0, 0x124a45b, 0x124a494, {0x89, 0xcb} },
28-
{0x125dd40, 0x125df13, 0x125df36, {0x89, 0xc3} },
29-
{0x12c42d0, 0x12c4324, 0x12c434d, {0x89, 0xc2} },
30-
{0x13e8a70, 0x13e8aa7, 0x13e8ad0, {0x89, 0xc2} },
31-
{0x1414050, 0x14140a5, 0x14140ce, {0x89, 0xc2} },
32-
{0x1561160, 0x15611ee, 0x1561217, {0x89, 0xc2} },
33-
{0x1567e00, 0x1567e50, 0x1567e79, {0x89, 0xc2} },
34-
{0x1569160, 0x1569195, 0x15691be, {0x89, 0xc2} },
35-
{0x1845e20, 0x1845ee1, 0x1845efd, {0x89, 0xc8} },
36-
{0x1845f60, 0x1845fdd, 0x1846007, {0x89, 0xc6} },
37-
{0x1e58d20, 0x1e59259, 0x1e59281, {0x41, 0x89, 0xc9} },
38-
{0x1e59450, 0x1e5953f, 0x1e59567, {0x41, 0x89, 0xc9} },
39-
{0x2806f90, 0x2807015, 0x2807038, {0x41, 0x89, 0x0a} },
40-
{0x2b4cd80, 0x2b4d224, 0x2b4d24c, {0x41, 0x89, 0xc9} },
41-
{0x2d3faf0, 0x2d40377, 0x2d403a2, {0x89, 0xc3} },
42-
{0x2d41c50, 0x2d42cfa, 0x2d42d18, {0x41, 0x89, 0xc8} },
43-
{0x2db2420, 0x2db2600, 0x2db261c, {0x89, 0xc8} },
44-
{0x2e11b70, 0x2e11c65, 0x2e11c87, {0x89, 0xc3} },
45-
{0x30c55e0, 0x30c5d91, 0x30c5db7, {0x41, 0x89, 0xc6} },
46-
{0x30c6720, 0x30c6cf7, 0x30c6d26, {0x89, 0x8e, 0xe0, 0x0a, 0x00, 0x00}},
47-
{0x30c8530, 0x30c896e, 0x30c8999, {0x89, 0xc3} },
48-
{0x30c8530, 0x30c8e1a, 0x30c8e46, {0x89, 0xdf} },
49-
{0x30e0b00, 0x30e0b80, 0x30e0bb0, {0x89, 0x0b} },
50-
{0x30e0c00, 0x30e0c10, 0x30e0c3b, {0x89, 0xd3} },
51-
{0x30e0f30, 0x30e116f, 0x30e118b, {0x89, 0xcb} },
52-
{0x30e1220, 0x30e1350, 0x30e1379, {0x89, 0xc3} },
53-
{0x37344a0, 0x3734511, 0x3734539, {0x41, 0x89, 0xd9} },
54-
{0x3742570, 0x3742633, 0x3742656, {0x89, 0xc3} },
55-
{0x38d0ca0, 0x38d0e11, 0x38d0e2d, {0x89, 0xc8} },
56-
{0x38d12e0, 0x38d1512, 0x38d1540, {0x41, 0x89, 0xc6} },
57-
{0x38d42f0, 0x38d4440, 0x38d4464, {0x89, 0xc7} },
58-
{0x38d44d0, 0x38d466e, 0x38d468a, {0x89, 0xc8} },
59-
{0x38f7670, 0x38f7682, 0x38f76b0, {0x41, 0x89, 0xc3} },
60-
{0x3924920, 0x3924920, 0x3924942, {0x89, 0x11} },
61-
{0x3db11c0, 0x3db1274, 0x3db1290, {0x89, 0xc8} },
62-
{0x3e5e340, 0x3e5e418, 0x3e5e440, {0x89, 0xc7} },
63-
{0x3e5feb0, 0x3e5ff78, 0x3e5ff94, {} },
64-
{0x3eaf040, 0x3eaf165, 0x3eaf189, {0x89, 0xcb} },
65-
{0x3eb0020, 0x3eb009e, 0x3eb00c3, {0x89, 0xdf} },
19+
{0x0913f00, 0x0914164, 0x091418f, {0x89, 0xc8} },
20+
{0x099c570, 0x099c676, 0x099c699, {0x89, 0xcb} },
21+
{0x099c880, 0x099c992, 0x099c9b5, {0x89, 0xcb} },
22+
{0x099cba0, 0x099ccb0, 0x099ccd3, {0x89, 0xcb} },
23+
{0x09a3280, 0x09a3638, 0x09a365c, {0x89, 0xc7} },
24+
{0x11be120, 0x11be1e1, 0x11be1fd, {0x89, 0xc8} },
25+
{0x11be260, 0x11be2dd, 0x11be307, {0x89, 0xc6} },
26+
{0x14b4dd0, 0x14b5066, 0x14b5090, {0x89, 0x4e, 0x3c} },
27+
{0x154c370, 0x154c5f7, 0x154c613, {0x89, 0xcf} },
28+
{0x154c880, 0x154cde1, 0x154ce0c, {0x89, 0xc3} },
29+
{0x1980180, 0x19802ea, 0x1980306, {0x89, 0xcb} },
30+
{0x19d12b0, 0x19d1304, 0x19d132d, {0x89, 0xc2} },
31+
{0x1c57aa0, 0x1c57b16, 0x1c57b3f, {0x89, 0xc2} },
32+
{0x1d13a20, 0x1d13bda, 0x1d13bfd, {0x89, 0xc3} },
33+
{0x1df6730, 0x1df6780, 0x1df67a9, {0x89, 0xc2} },
34+
{0x1df7de0, 0x1df7e15, 0x1df7e3e, {0x89, 0xc2} },
35+
{0x1ecada0, 0x1ecae71, 0x1ecae9a, {0x89, 0xc2} },
36+
{0x2066f30, 0x2066f8d, 0x2066fb6, {0x89, 0xc2} },
37+
{0x21ea950, 0x21eaa11, 0x21eaa2d, {0x89, 0xc8} },
38+
{0x21eaa90, 0x21eab0d, 0x21eab37, {0x89, 0xc6} },
39+
{0x28b9d30, 0x28ba081, 0x28ba0a9, {0x41, 0x89, 0xc9} },
40+
{0x28ba300, 0x28ba3b1, 0x28ba3d9, {0x89, 0xcf} },
41+
{0x32dc680, 0x32dc705, 0x32dc728, {0x41, 0x89, 0x0a} },
42+
{0x34ae010, 0x34ae2fa, 0x34ae322, {0x41, 0x89, 0xc9} },
43+
{0x38d2ad0, 0x38d32c4, 0x38d32ef, {0x89, 0xcb} },
44+
{0x38d4b90, 0x38d5ac6, 0x38d5ae4, {0x41, 0x89, 0xc8} },
45+
{0x38efae0, 0x38efcbf, 0x38efcdb, {0x89, 0xc8} },
46+
{0x39f5480, 0x39f5579, 0x39f559b, {0x89, 0xc3} },
47+
{0x3bdbf50, 0x3bdc651, 0x3bdc677, {0x41, 0x89, 0xce} },
48+
{0x3bdcf80, 0x3bdd528, 0x3bdd557, {0x89, 0x8e, 0xd0, 0x0a, 0x00, 0x00}},
49+
{0x3bdec40, 0x3bdf07f, 0x3bdf0aa, {0x89, 0xc3} },
50+
{0x3bdec40, 0x3bdf514, 0x3bdf540, {0x89, 0xdf} },
51+
{0x3bf7710, 0x3bf7790, 0x3bf77c0, {0x89, 0x0b} },
52+
{0x3bf7810, 0x3bf7820, 0x3bf784b, {0x89, 0xd3} },
53+
{0x3bf7b20, 0x3bf7d5a, 0x3bf7d76, {0x89, 0xcb} },
54+
{0x3bf7e10, 0x3bf7f46, 0x3bf7f6f, {0x89, 0xc3} },
55+
{0x4260e30, 0x4260e90, 0x4260eb8, {0x41, 0x89, 0xd9} },
56+
{0x426dcc0, 0x426dda0, 0x426ddc9, {0x89, 0xc2} },
57+
{0x43fa280, 0x43fa3f1, 0x43fa40d, {0x89, 0xc8} },
58+
{0x43fa890, 0x43faad2, 0x43fab00, {0x41, 0x89, 0xc4} },
59+
{0x43fd740, 0x43fd894, 0x43fd8b8, {0x89, 0xc7} },
60+
{0x43fd930, 0x43fdac9, 0x43fdae5, {0x89, 0xc8} },
61+
{0x44c59d0, 0x44c5a06, 0x44c5a2c, {0x89, 0x4b, 0x40} },
62+
{0x48926e0, 0x4892801, 0x4892837, {0x89, 0xcf} },
63+
{0x4893360, 0x48933df, 0x4893404, {0x89, 0xdf} },
64+
{0x4899570, 0x4899805, 0x4899821, {0x89, 0xc8} },
65+
{0x4984c20, 0x4984cf8, 0x4984d20, {0x89, 0xc7} },
66+
{0x4986750, 0x49867f5, 0x4986811, {} },
6667
};
6768

6869
bool PatchFunction(HMODULE hModule, DWORD faddress_start, DWORD faddress_end, const std::vector<BYTE>& native_code) {

src/test/generator/flat-gen-village/FlatVillageGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool FlatVillageGenerator::postProcess(ChunkViewSource& neighborhood) {
6161
void FlatVillageGenerator::loadChunk(LevelChunk& levelchunk, bool forceImmediateReplacementDataLoad) {
6262
auto chunkPos = levelchunk.mPosition;
6363

64-
auto blockPos = BlockPos(chunkPos, 0);
64+
auto blockPos = BlockPos(chunkPos->x, 0, chunkPos->z);
6565
DividedPos2d<4> dividedPos2D;
6666
dividedPos2D.x = (blockPos.x >> 31) - ((blockPos.x >> 31) - blockPos.x) / 4;
6767
dividedPos2D.z = (blockPos.z >> 31) - ((blockPos.z >> 31) - blockPos.z) / 4;

src/test/generator/generator-custom-structure/generator/CustomStructureGenerator.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
#include "test/mc/FixedBiomeSource.h"
44

5-
#include "mc/deps/core/math/Random.h"
6-
#include "mc/platform/threading/Mutex.h"
7-
#include "mc/util/ThreadOwner.h"
85
#include "mc/world/level/BlockSource.h"
96
#include "mc/world/level/ChunkPos.h"
107
#include "mc/world/level/Level.h"
@@ -63,7 +60,7 @@ bool CustomStructureGenerator::postProcess(ChunkViewSource& neighborhood) {
6360
void CustomStructureGenerator::loadChunk(LevelChunk& levelchunk, bool forceImmediateReplacementDataLoad) {
6461
auto chunkPos = levelchunk.mPosition;
6562

66-
auto blockPos = BlockPos(chunkPos, 0);
63+
auto blockPos = BlockPos(chunkPos->x, 0, chunkPos->z);
6764
DividedPos2d<4> dividedPos2D;
6865
dividedPos2D.x = (blockPos.x >> 31) - ((blockPos.x >> 31) - blockPos.x) / 4;
6966
dividedPos2D.z = (blockPos.z >> 31) - ((blockPos.z >> 31) - blockPos.z) / 4;

src/test/generator/generator-custom-structure/structure/CustomStructureFeature.cpp

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
#include "test/generator/generator-custom-structure/structure/CustomStructurePiece.h"
44
#include "test/generator/generator-custom-structure/structure/CustomStructureStart.h"
55

6-
7-
#include "mc/deps/core/math/Random.h"
86
#include "mc/deps/core/string/HashedString.h"
97
#include "mc/util/Random.h"
8+
#include "mc/world/actor/ActorDefinitionIdentifier.h"
109
#include "mc/world/level/ChunkPos.h"
1110
#include "mc/world/level/Level.h"
1211
#include "mc/world/level/biome/Biome.h"
@@ -28,11 +27,31 @@ bool CustomStructureFeature::getNearestGeneratedFeature(
2827
bool mustBeInNewChunks,
2928
::std::optional<::HashedString> const& biomeTag
3029
) {
31-
return StructureFeature::findNearestFeaturePositionBySpacing(dimension, preliminarySurfaceLevel, *this, biomeTag, biomeSource, origin, pos, mMaxSpacing, mMinSpacing, 39281139, true, 0, mustBeInNewChunks);
30+
return StructureFeature::findNearestFeaturePositionBySpacing(
31+
dimension,
32+
preliminarySurfaceLevel,
33+
*this,
34+
biomeTag,
35+
biomeSource,
36+
origin,
37+
pos,
38+
mMaxSpacing,
39+
mMinSpacing,
40+
39281139,
41+
true,
42+
0,
43+
mustBeInNewChunks
44+
);
3245
};
3346

34-
bool CustomStructureFeature::
35-
isFeatureChunk(::BiomeSource const&, ::Random& random, ::ChunkPos const& cpos, uint, ::IPreliminarySurfaceProvider const&, ::Dimension const&) {
47+
bool CustomStructureFeature::isFeatureChunk(
48+
::BiomeSource const&,
49+
::Random& random,
50+
::ChunkPos const& cpos,
51+
uint,
52+
::IPreliminarySurfaceProvider const&,
53+
::Dimension const&
54+
) {
3655
int salt = 39281139;
3756
uint newSeed = mSeed + salt + 0xF1565BD5 * (cpos.z / mMaxSpacing) - 0x66C60AF8 * (cpos.x / mMaxSpacing);
3857
random.mRandom->mObject.mHaveNextNextGaussian = false;
@@ -54,13 +73,21 @@ bool CustomStructureFeature::
5473
auto random_int_x = (random.nextInt(able_spacing) + random.nextInt(able_spacing)) / 2;
5574
auto random_int_z = (random.nextInt(able_spacing) + random.nextInt(able_spacing)) / 2;
5675

57-
ChunkPos target_cpos(able_spacing * (cpos.x / able_spacing) + random_int_x, able_spacing * (cpos.z / able_spacing) + random_int_z);
76+
ChunkPos target_cpos(
77+
able_spacing * (cpos.x / able_spacing) + random_int_x,
78+
able_spacing * (cpos.z / able_spacing) + random_int_z
79+
);
5880
if (cpos != target_cpos) return false;
5981
return true;
6082
};
6183

62-
std::unique_ptr<::StructureStart> CustomStructureFeature::
63-
createStructureStart(::Dimension& dim, ::BiomeSource const& biomeSource, ::Random& random, ::ChunkPos const& cpos, ::IPreliminarySurfaceProvider const&) {
84+
std::unique_ptr<::StructureStart> CustomStructureFeature::createStructureStart(
85+
::Dimension& dim,
86+
::BiomeSource const& biomeSource,
87+
::Random& random,
88+
::ChunkPos const& cpos,
89+
::IPreliminarySurfaceProvider const&
90+
) {
6491
auto start = std::make_unique<CustomStructureStart>();
6592
CustomStructurePiece::addPieces(
6693
{cpos.x * 16, 0, cpos.z * 16},

src/test/generator/generator-custom-structure/structure/CustomStructurePiece.cpp

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
#include "CustomStructurePiece.h"
22

33
#include "mc/util/Random.h"
4+
#include "mc/world/actor/ActorDefinitionIdentifier.h"
45
#include "mc/world/level/BlockPos.h"
56
#include "mc/world/level/block/VanillaBlockTypeIds.h"
67
#include "mc/world/level/block/registry/BlockTypeRegistry.h"
78
#include "mc/world/level/dimension/Dimension.h"
89
#include "mc/world/level/levelgen/structure/BoundingBox.h"
9-
#include "test/mc/JigsawJunction.h"
10-
#include "test/mc/JigsawPlacement.h"
1110
#include "mc/world/level/levelgen/structure/registry/JigsawStructureRegistry.h"
1211
#include "mc/world/level/levelgen/structure/structurepools/StructurePoolElement.h"
13-
#include "test/mc/StructureTemplatePool.h"
14-
#include "test/mc/PoolAliasBinding.h"
1512
#include "mc/world/level/levelgen/v1/AdjustmentEffect.h"
16-
13+
#include "test/mc/JigsawPlacement.h"
14+
#include "test/mc/StructureTemplatePool.h"
1715

1816
#include <memory>
1917

20-
2118
namespace custom_structure {
2219

23-
int CustomStructurePiece::
24-
generateHeightAtPosition(BlockPos const&, Dimension& dim, BlockVolume&, std::unordered_map<ChunkPos, std::unique_ptr<std::vector<short>>>&)
25-
const {
20+
int CustomStructurePiece::generateHeightAtPosition(
21+
BlockPos const&,
22+
Dimension& dim,
23+
BlockVolume&,
24+
std::unordered_map<ChunkPos, std::unique_ptr<std::vector<short>>>&
25+
) const {
2626
return dim.mSeaLevel + 100;
2727
};
2828

@@ -70,13 +70,7 @@ void CustomStructurePiece::addPieces(
7070
JigsawPlacement place(15, 80, pieces, lambda, random, pools, dimension);
7171

7272
auto index = random.nextInt(0, templates->mTemplates->size() - 1);
73-
place.addPieces(
74-
*templates->mTemplates->at(index),
75-
position,
76-
Rotation(random.nextInt(4)),
77-
"",
78-
{}
79-
);
73+
place.addPieces(*templates->mTemplates->at(index), position, Rotation(random.nextInt(4)), "", {});
8074
}
8175

8276
} // namespace custom_structure

src/test/generator/generator-terrain/NxnBorderTerrainGenerator.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@
77
#include "test/mc/FixedBiomeSource.h"
88

99
#include "mc/world/level/ChunkPos.h"
10-
#include "mc/world/level/block/BedrockBlockNames.h"
1110
#include "mc/world/level/block/Block.h"
12-
#include "mc/world/level/block/BlockVolume.h"
1311
#include "mc/world/level/block/VanillaBlockTypeIds.h"
1412
#include "mc/world/level/block/registry/BlockTypeRegistry.h"
1513
#include "mc/world/level/chunk/LevelChunk.h"
1614
#include "mc/world/level/dimension/Dimension.h"
1715
#include "mc/world/level/levelgen/v1/ChunkLocalNoiseCache.h"
1816

19-
#include "mc/world/level/block/Block.h"
20-
2117

2218
namespace nxn_border_terrain {
2319

0 commit comments

Comments
 (0)