summaryrefslogtreecommitdiffstats
path: root/src/BlockID.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-11-23 18:12:34 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-11-23 18:12:34 +0100
commit79e5b823547a2a51d9f4e504fc24ec539e11ac34 (patch)
tree672b77f1c9a4741437b30f3289fc258d7917a2eb /src/BlockID.cpp
parentCompilation fixes (diff)
parentMerge pull request #1612 from p-mcgowan/pigsIntoZombiePigmenOnLightning (diff)
downloadcuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar.gz
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar.bz2
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar.lz
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar.xz
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.tar.zst
cuberite-79e5b823547a2a51d9f4e504fc24ec539e11ac34.zip
Diffstat (limited to '')
-rw-r--r--src/BlockID.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/BlockID.cpp b/src/BlockID.cpp
index c0f3193bb..c98e0cad1 100644
--- a/src/BlockID.cpp
+++ b/src/BlockID.cpp
@@ -217,7 +217,12 @@ BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString)
bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item)
{
- return gsBlockIDMap.ResolveItem(TrimString(a_ItemTypeString), a_Item);
+ AString ItemName = TrimString(a_ItemTypeString);
+ if (ItemName.substr(0, 10) == "minecraft:")
+ {
+ ItemName = ItemName.substr(10);
+ }
+ return gsBlockIDMap.ResolveItem(ItemName, a_Item);
}