mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Players can no longer be given air (causes client crash) through /give.
Fixes #567.
This commit is contained in:
parent
f3f6828699
commit
330e06b892
@ -227,6 +227,10 @@ class BlockAPI{
|
||||
$output .= "Player is in creative mode.\n";
|
||||
break;
|
||||
}
|
||||
if($item->getID() == 0) {
|
||||
$output .= "You cannot give an air block to a player.\n";
|
||||
break;
|
||||
}
|
||||
$player->addItem($item->getID(), $item->getMetadata(), $item->count);
|
||||
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n";
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user