summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/WSSAnvil.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 19:34:58 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 19:34:58 +0200
commit5c53608dd0e59d67a9aad5b03a58e1ff48d619b3 (patch)
tree69a2dca7e22c0dcfb6f069c81488814ae49c74df /src/WorldStorage/WSSAnvil.cpp
parentAdded the new functions to APIDump. (diff)
downloadcuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.gz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.bz2
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.lz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.xz
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.tar.zst
cuberite-5c53608dd0e59d67a9aad5b03a58e1ff48d619b3.zip
Diffstat (limited to '')
-rw-r--r--src/WorldStorage/WSSAnvil.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index e79cc291d..5c155aeef 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -2640,6 +2640,19 @@ bool cWSSAnvil::LoadMonsterBaseFromNBT(cMonster & a_Monster, const cParsedNBT &
a_Monster.SetCanPickUpLoot(CanPickUpLoot);
}
+ int CustomNameTag = a_NBT.FindChildByName(a_TagIdx, "CustomName");
+ if ((CustomNameTag > 0) && (a_NBT.GetType(CustomNameTag) == TAG_String))
+ {
+ a_Monster.SetCustomName(a_NBT.GetString(CustomNameTag));
+ }
+
+ int CustomNameVisibleTag = a_NBT.FindChildByName(a_TagIdx, "CustomNameVisible");
+ if ((CustomNameVisibleTag > 0) && (a_NBT.GetType(CustomNameVisibleTag) == TAG_Byte))
+ {
+ bool CustomNameVisible = (a_NBT.GetByte(CustomNameVisibleTag) == 1);
+ a_Monster.SetCustomNameAlwaysVisible(CustomNameVisible);
+ }
+
return true;
}