diff options
author | 12xx12 <44411062+12xx12@users.noreply.github.com> | 2020-11-06 16:00:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-06 16:00:59 +0100 |
commit | 36a67df105ab4774d2a250ef3c7d6336cb50566e (patch) | |
tree | 2725a48a3c8a8de5f6ef062d9415d019042ba486 /src/WorldStorage/WSSAnvil.cpp | |
parent | Players are no longer kicked when clicking on bedrock (#5023) (diff) | |
download | cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar.gz cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar.bz2 cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar.lz cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar.xz cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.tar.zst cuberite-36a67df105ab4774d2a250ef3c7d6336cb50566e.zip |
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rwxr-xr-x | src/WorldStorage/WSSAnvil.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index c7b4c7e1f..cfea33737 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -1718,19 +1718,14 @@ void cWSSAnvil::LoadBoatFromNBT(cEntityList & a_Entities, const cParsedNBT & a_N void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { - auto EnderCrystal = std::make_unique<cEnderCrystal>(Vector3d(), false); - if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx)) - { - return; - } - + bool DisplayBeam = false, ShowBottom = false; + Vector3i BeamTarget; int CurrentLine = a_NBT.FindChildByName(a_TagIdx, "BeamTarget"); if (CurrentLine > 0) { - EnderCrystal->SetDisplayBeam(true); + DisplayBeam = true; if (a_NBT.GetType(CurrentLine) == TAG_Compound) { - Vector3d BeamTarget = {0, 0, 0}; int CoordinateLine = a_NBT.FindChildByName(CurrentLine, "X"); if (CoordinateLine > 0) { @@ -1751,7 +1746,13 @@ void cWSSAnvil::LoadEnderCrystalFromNBT(cEntityList & a_Entities, const cParsedN CurrentLine = a_NBT.FindChildByName(a_TagIdx, "ShowBottom"); if (CurrentLine > 0) { - EnderCrystal->SetShowBottom(a_NBT.GetByte(CurrentLine) == 1); + ShowBottom = a_NBT.GetByte(CurrentLine) == 1; + } + + auto EnderCrystal = std::make_unique<cEnderCrystal>(Vector3d(), BeamTarget, DisplayBeam, ShowBottom); + if (!LoadEntityBaseFromNBT(*EnderCrystal.get(), a_NBT, a_TagIdx)) + { + return; } a_Entities.emplace_back(std::move(EnderCrystal)); |