summaryrefslogtreecommitdiffstats
path: root/src/Generating/PiecePool.cpp
diff options
context:
space:
mode:
authorDamián Imrich <damian@haze.sk>2021-04-08 12:24:59 +0200
committerGitHub <noreply@github.com>2021-04-08 12:24:59 +0200
commitbefe132861b1995dfe776d4e134a90fc243d1a17 (patch)
treeee11f50ccb917718a4da7282a8e5243193571847 /src/Generating/PiecePool.cpp
parentObsidian pillars, end fountain, not Ender dragon spawning (#4993) (diff)
downloadcuberite-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.cpp24
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();