diff options
Diffstat (limited to 'src/WorldStorage/NamespaceSerializer.cpp')
-rw-r--r-- | src/WorldStorage/NamespaceSerializer.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/WorldStorage/NamespaceSerializer.cpp b/src/WorldStorage/NamespaceSerializer.cpp index 910054ff7..fd02fec68 100644 --- a/src/WorldStorage/NamespaceSerializer.cpp +++ b/src/WorldStorage/NamespaceSerializer.cpp @@ -1,7 +1,6 @@ #include "Globals.h" #include "NamespaceSerializer.h" -#include <cctype> @@ -552,17 +551,11 @@ eMonsterType NamespaceSerializer::ToMonsterType(const std::string_view a_ID) -AString NamespaceSerializer::Prettify(AString a_Name, const bool a_IsTamed) +AString NamespaceSerializer::Prettify(AString a_ID) { - // In older vanilla Minecraft version (before 1.14) ocelots and cats were the same mob. - // So after killing a tamed ocelot without a custom name the message will say "Cat was slain by [PlayerName]". - if ((a_Name == "ocelot") && a_IsTamed) - { - return "Cat"; - } bool NextLetterCapitalized = true; - std::for_each(a_Name.begin(), a_Name.end(), [&](char & a_Letter) + std::for_each(a_ID.begin(), a_ID.end(), [&](char & a_Letter) { if (NextLetterCapitalized) { @@ -575,5 +568,20 @@ AString NamespaceSerializer::Prettify(AString a_Name, const bool a_IsTamed) NextLetterCapitalized = true; } }); - return a_Name; + return a_ID; +} + + + + + +AString NamespaceSerializer::PrettifyEntityName(const AString & a_ID, const bool a_IsTamed) +{ + // In older vanilla Minecraft version (before 1.14) ocelots and cats were the same mob. + // So after killing a tamed ocelot without a custom name the message will say "Cat was slain by [PlayerName]". + if ((a_ID == "ocelot") && a_IsTamed) + { + return "Cat"; + } + return Prettify(a_ID); } |