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