Some changes

This commit is contained in:
Shoghi Cervantes 2014-09-29 16:37:56 +02:00
parent 5b6b789ab3
commit 9cd66dc969
2 changed files with 1 additions and 2 deletions

View File

@ -954,7 +954,7 @@ class Level implements ChunkManager, Metadatable{
*/ */
public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null, $delay = 10){ public function dropItem(Vector3 $source, Item $item, Vector3 $motion = null, $delay = 10){
$motion = $motion === null ? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1) : $motion; $motion = $motion === null ? new Vector3(lcg_value() * 0.2 - 0.1, 0.2, lcg_value() * 0.2 - 0.1) : $motion;
if($item->getID() !== Item::AIR and $item->getCount() > 0){ if($item->getID() > 0 and $item->getCount() > 0){
$itemEntity = new DroppedItem($this->getChunk($source->getX() >> 4, $source->getZ() >> 4), new Compound("", [ $itemEntity = new DroppedItem($this->getChunk($source->getX() >> 4, $source->getZ() >> 4), new Compound("", [
"Pos" => new Enum("Pos", [ "Pos" => new Enum("Pos", [
new Double("", $source->getX()), new Double("", $source->getX()),

View File

@ -73,7 +73,6 @@ use pocketmine\network\protocol\UnloadChunkPacket;
use pocketmine\network\protocol\UpdateBlockPacket; use pocketmine\network\protocol\UpdateBlockPacket;
use pocketmine\network\protocol\UseItemPacket; use pocketmine\network\protocol\UseItemPacket;
use pocketmine\Player; use pocketmine\Player;
use pocketmine\scheduler\CallbackTask;
use pocketmine\Server; use pocketmine\Server;
use pocketmine\utils\TextFormat; use pocketmine\utils\TextFormat;
use raklib\protocol\EncapsulatedPacket; use raklib\protocol\EncapsulatedPacket;