From 330e06b8925ceb018d8c63f9048517a9a3d7aace Mon Sep 17 00:00:00 2001 From: williamtdr Date: Wed, 31 Jul 2013 22:08:34 -0500 Subject: [PATCH] Players can no longer be given air (causes client crash) through /give. Fixes #567. --- src/API/BlockAPI.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 9e478bd0..ed653eed 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -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{