summaryrefslogtreecommitdiffstats
path: root/src/BlockID.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-10-29 22:35:16 +0100
committerMattes D <github@xoft.cz>2014-10-29 22:35:16 +0100
commitd898fb904b16e9a08818bcf14d0646db5fb02dde (patch)
tree43821c2e6604e563f5e9a1cc4e9be054d62d7a23 /src/BlockID.cpp
parentQtBiomeVisualiser: Added quick shutdown to region loaders. (diff)
parentFixed 1.8 world item format reading. (diff)
downloadcuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar.gz
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar.bz2
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar.lz
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar.xz
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.tar.zst
cuberite-d898fb904b16e9a08818bcf14d0646db5fb02dde.zip
Diffstat (limited to 'src/BlockID.cpp')
-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);
}