113 $key = $this->reprocess($input);
114 $b = explode(
":", $key);
118 }elseif(is_numeric($b[1])){
121 throw new LegacyStringToItemParserException(
"Unable to parse \"" . $b[1] .
"\" from \"" . $input .
"\" as a valid meta value");
124 $lower = strtolower($b[0]);
125 if($lower ===
"0" || $lower ===
"air"){
127 return VanillaItems::AIR();
130 $legacyId = $this->map[$lower] ??
null;
131 if($legacyId ===
null){
132 throw new LegacyStringToItemParserException(
"Unable to resolve \"" . $input .
"\" to a valid item");
134 $itemData = $this->itemDataUpgrader->upgradeItemTypeDataString($legacyId, $meta, 1,
null);
137 return $this->itemDeserializer->deserializeStack($itemData);
138 }
catch(ItemTypeDeserializeException $e){
139 throw new LegacyStringToItemParserException($e->getMessage(), 0, $e);