mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-13 13:25:16 +00:00
ItemFactory: fix crash when getting negative item IDs
these are now treated the same as any unknown item, and are now not possible to place.
This commit is contained in:
parent
37c2d78731
commit
769cc91543
@ -318,7 +318,7 @@ class ItemFactory{
|
|||||||
$listed = self::$list[self::getListOffset($id)];
|
$listed = self::$list[self::getListOffset($id)];
|
||||||
if($listed !== null){
|
if($listed !== null){
|
||||||
$item = clone $listed;
|
$item = clone $listed;
|
||||||
}elseif($id < 256){ //intentionally includes negatives, for extended block IDs
|
}elseif($id >= 0 and $id < 256){ //intentionally excludes negatives because extended blocks aren't supported yet
|
||||||
/* Blocks must have a damage value 0-15, but items can have damage value -1 to indicate that they are
|
/* Blocks must have a damage value 0-15, but items can have damage value -1 to indicate that they are
|
||||||
* crafting ingredients with any-damage. */
|
* crafting ingredients with any-damage. */
|
||||||
$item = new ItemBlock($id, $meta);
|
$item = new ItemBlock($id, $meta);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user