mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Fixed Item fromString() crash on PHP 7.2
This commit is contained in:
parent
a06c934f4d
commit
00e4fff259
@ -338,11 +338,13 @@ class ItemFactory{
|
|||||||
|
|
||||||
if(defined(Item::class . "::" . strtoupper($b[0]))){
|
if(defined(Item::class . "::" . strtoupper($b[0]))){
|
||||||
$item = self::get(constant(Item::class . "::" . strtoupper($b[0])), $meta);
|
$item = self::get(constant(Item::class . "::" . strtoupper($b[0])), $meta);
|
||||||
if($item->getId() === Item::AIR and strtoupper($b[0]) !== "AIR"){
|
if($item->getId() === Item::AIR and strtoupper($b[0]) !== "AIR" and is_numeric($b[0])){
|
||||||
$item = self::get($b[0] & 0xFFFF, $meta);
|
$item = self::get(((int) $b[0]) & 0xFFFF, $meta);
|
||||||
}
|
}
|
||||||
|
}elseif(is_numeric($b[0])){
|
||||||
|
$item = self::get(((int) $b[0]) & 0xFFFF, $meta);
|
||||||
}else{
|
}else{
|
||||||
$item = self::get($b[0] & 0xFFFF, $meta);
|
$item = self::get(Item::AIR, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $item;
|
return $item;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user