summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2016-01-12 00:52:25 +0100
committerworktycho <work.tycho@gmail.com>2016-01-12 00:52:25 +0100
commit7aa0b7299dad299a0b980d66793f43c70ecdd55f (patch)
tree3653367aaab3ddaeee96b5c3f9c3c6ed6d4bb9fd /src/WorldStorage/WSSAnvil.cpp
parentMerge pull request #2848 from Nakkar/master (diff)
parentChanged the format of the MobHead data to allow MobHeads working on MInecraft 1.8 (diff)
downloadcuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar.gz
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar.bz2
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar.lz
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar.xz
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.tar.zst
cuberite-7aa0b7299dad299a0b980d66793f43c70ecdd55f.zip
Diffstat (limited to 'src/WorldStorage/WSSAnvil.cpp')
-rwxr-xr-xsrc/WorldStorage/WSSAnvil.cpp43
1 files changed, 40 insertions, 3 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 5138717a7..3d325d354 100755
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -1293,10 +1293,47 @@ cBlockEntity * cWSSAnvil::LoadMobHeadFromNBT(const cParsedNBT & a_NBT, int a_Tag
MobHead->SetRotation(static_cast<eMobHeadRotation>(a_NBT.GetByte(currentLine)));
}
- currentLine = a_NBT.FindChildByName(a_TagIdx, "ExtraType");
- if (currentLine >= 0)
+ int ownerLine = a_NBT.FindChildByName(a_TagIdx, "Owner");
+ if (ownerLine >= 0)
{
- MobHead->SetOwner(a_NBT.GetString(currentLine));
+ AString OwnerName, OwnerUUID, OwnerTexture, OwnerTextureSignature;
+
+ currentLine = a_NBT.FindChildByName(ownerLine, "Id");
+ if (currentLine >= 0)
+ {
+ OwnerUUID = a_NBT.GetString(currentLine);
+ }
+
+ currentLine = a_NBT.FindChildByName(ownerLine, "Name");
+ if (currentLine >= 0)
+ {
+ OwnerName = a_NBT.GetString(currentLine);
+ }
+
+ int textureLine = a_NBT.GetFirstChild( // The first texture of
+ a_NBT.FindChildByName( // The texture list of
+ a_NBT.FindChildByName( // The Properties compound of
+ ownerLine, // The Owner compound
+ "Properties"
+ ),
+ "textures"
+ )
+ );
+ if (textureLine >= 0)
+ {
+ currentLine = a_NBT.FindChildByName(textureLine, "Signature");
+ if (currentLine >= 0)
+ {
+ OwnerTextureSignature = a_NBT.GetString(currentLine);
+ }
+
+ currentLine = a_NBT.FindChildByName(textureLine, "Value");
+ if (currentLine >= 0)
+ {
+ OwnerTexture = a_NBT.GetString(currentLine);
+ }
+ }
+ MobHead->SetOwner(OwnerUUID, OwnerName, OwnerTexture, OwnerTextureSignature);
}
return MobHead.release();