diff options
author | Damián Imrich <damian@haze.sk> | 2021-04-08 12:24:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-08 12:24:59 +0200 |
commit | befe132861b1995dfe776d4e134a90fc243d1a17 (patch) | |
tree | ee11f50ccb917718a4da7282a8e5243193571847 /src/Generating/Prefab.cpp | |
parent | Obsidian pillars, end fountain, not Ender dragon spawning (#4993) (diff) | |
download | cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar.gz cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar.bz2 cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar.lz cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar.xz cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.tar.zst cuberite-befe132861b1995dfe776d4e134a90fc243d1a17.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/Prefab.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 7c8c3c0bc..0a7b2a89b 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -157,8 +157,24 @@ void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumR return; } - // Write the image: - a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + if (m_Modifiers.size() == 0) + { + // Write the image: + a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + } + else + { + cBlockArea RandomizedImage; + Image.CopyTo(RandomizedImage); + + for (size_t i = 0; i < m_Modifiers.size(); i++) + { + m_Modifiers[i]->Modify(RandomizedImage, a_Placement, a_NumRotations); + } + + // Write the modified image: + a_Dest.WriteBlockArea(RandomizedImage, Placement.x, Placement.y, Placement.z, m_MergeStrategy); + } // If requested, draw the floor (from the bottom of the prefab down to the nearest non-air) switch (m_ExtendFloorStrategy) |