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/PiecePool.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/PiecePool.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Generating/PiecePool.cpp b/src/Generating/PiecePool.cpp index 4b4303516..a7c28e75a 100644 --- a/src/Generating/PiecePool.cpp +++ b/src/Generating/PiecePool.cpp @@ -8,6 +8,7 @@ #include "PiecePool.h" #include "VerticalStrategy.h" #include "VerticalLimit.h" +#include "PieceModifier.h" @@ -46,6 +47,29 @@ bool cPiece::SetVerticalLimitFromString(const AString & a_LimitDesc, bool a_LogW +bool cPiece::SetPieceModifiersFromString(const AString & a_Definition, bool a_LogWarnings) +{ + auto modifiers = std::make_shared<cPieceModifiers>(); + if (!CreatePieceModifierFromString(a_Definition, modifiers, a_LogWarnings)) + { + return false; + } + + cPieceModifiers Modifiers; + for (size_t i = 0; i < modifiers->size(); i++) + { + Modifiers.push_back(std::move(modifiers->at(i))); + } + + m_Modifiers = Modifiers; + + return true; +} + + + + + Vector3i cPiece::RotatePos(const Vector3i & a_Pos, int a_NumCCWRotations) const { Vector3i Size = GetSize(); |