summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-05-22 17:41:41 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-22 18:10:12 +0200
commitfc49ace897fadb4c3d555dd05974c51a97cd9d6a (patch)
tree5c514858b4704f9b4f390eba1a9fb32ffdb916d8 /src/Protocol
parentClang 5.0 fixes (diff)
downloadcuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar.gz
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar.bz2
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar.lz
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar.xz
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.tar.zst
cuberite-fc49ace897fadb4c3d555dd05974c51a97cd9d6a.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol_1_9.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp
index 2a6c924b0..e489b3903 100644
--- a/src/Protocol/Protocol_1_9.cpp
+++ b/src/Protocol/Protocol_1_9.cpp
@@ -2995,9 +2995,11 @@ void cProtocol_1_9_0::ParseItemMetadata(cItem & a_Item, const AString & a_Metada
{
if ((NBT.GetType(entitytag) == TAG_String) && (NBT.GetName(entitytag) == "id"))
{
- eMonsterType MonsterType = cMonster::StringToMobType(NBT.GetString(entitytag));
- // No special method here to convert to the numeric damage value; just cast to the given ID
+ AString NBTName = NBT.GetString(entitytag);
+ ReplaceString(NBTName, "minecraft:", "");
+ eMonsterType MonsterType = cMonster::StringToMobType(NBTName);
a_Item.m_ItemDamage = static_cast<short>(MonsterType);
+
}
}
}
@@ -3395,7 +3397,7 @@ void cProtocol_1_9_0::WriteItem(cPacketizer & a_Pkt, const cItem & a_Item)
if (MonsterType != eMonsterType::mtInvalidType)
{
Writer.BeginCompound("EntityTag");
- Writer.AddString("id", cMonster::MobTypeToVanillaName(MonsterType));
+ Writer.AddString("id", "minecraft:" + cMonster::MobTypeToVanillaNBT(MonsterType));
Writer.EndCompound();
}
}