mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +00:00
Some changes
This commit is contained in:
parent
5b6b789ab3
commit
9cd66dc969
@ -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()),
|
||||||
|
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user