mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-03 00:29:54 +00:00
LegacyStringToItemParser: special-case air, which the item deserializer doesn't recognize
This commit is contained in:
parent
67682cbf27
commit
47adcf763d
@ -118,7 +118,13 @@ final class LegacyStringToItemParser{
|
|||||||
throw new LegacyStringToItemParserException("Unable to parse \"" . $b[1] . "\" from \"" . $input . "\" as a valid meta value");
|
throw new LegacyStringToItemParserException("Unable to parse \"" . $b[1] . "\" from \"" . $input . "\" as a valid meta value");
|
||||||
}
|
}
|
||||||
|
|
||||||
$legacyId = $this->map[strtolower($b[0])] ?? null;
|
$lower = strtolower($b[0]);
|
||||||
|
if($lower === "0" || $lower === "air"){
|
||||||
|
//item deserializer doesn't recognize air items since they aren't supposed to exist
|
||||||
|
return VanillaItems::AIR();
|
||||||
|
}
|
||||||
|
|
||||||
|
$legacyId = $this->map[$lower] ?? null;
|
||||||
if($legacyId === null){
|
if($legacyId === null){
|
||||||
throw new LegacyStringToItemParserException("Unable to resolve \"" . $input . "\" to a valid item");
|
throw new LegacyStringToItemParserException("Unable to resolve \"" . $input . "\" to a valid item");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user