mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +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
1 changed files with 4 additions and 0 deletions
|
|
@ -227,6 +227,10 @@ class BlockAPI{
|
||||||
$output .= "Player is in creative mode.\n";
|
$output .= "Player is in creative mode.\n";
|
||||||
break;
|
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);
|
$player->addItem($item->getID(), $item->getMetadata(), $item->count);
|
||||||
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n";
|
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n";
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue