Particles.

This commit is contained in:
Shoghi Cervantes 2015-03-18 16:34:19 +01:00
parent b31604a536
commit c2a3298a7e
25 changed files with 788 additions and 54 deletions

View File

@ -1288,7 +1288,7 @@ class Level implements ChunkManager, Metadatable{
}
$drops = $target->getDrops($item); //Fixes tile entities being deleted before getting drops
$this->addParticle(new DestroyBlockParticle($target, $target));
$this->addParticle(new DestroyBlockParticle($target->add(0.5, 0.5, 0.5), $target));
$target->onBreak($item);

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class BubbleParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 1);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class CriticalParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 2);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class DustParticle extends GenericParticle{
public function __construct(Vector3 $pos, $r, $g, $b, $a = 255){
parent::__construct($pos->x, $pos->y, $pos->z, 22, (($a & 0xff) << 24) | (($r & 0xff) << 16) | (($g & 0xff) << 8) | ($b & 0xff));
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class EnchantParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 23);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class EntityFlameParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 13);
}
}

View File

@ -21,22 +21,10 @@
namespace pocketmine\level\particle;
use pocketmine\network\protocol\ExplodePacket;
use pocketmine\math\Vector3;
class ExplodeParticle extends Particle{
class ExplodeParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z);
}
public function encode(){
$pk = new ExplodePacket;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->radius = 0;
return $pk;
parent::__construct($pos->x, $pos->y, $pos->z, 4);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class FlameParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 5);
}
}

View File

@ -0,0 +1,48 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\network\protocol\LevelEventPacket;
use pocketmine\math\Vector3;
class GenericParticle extends Particle{
protected $id;
protected $data;
public function __construct(Vector3 $pos, $id, $data = 0){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->id = $id & 0xFFF;
$this->data = $data;
}
public function encode(){
$pk = new LevelEventPacket;
$pk->evid = 0x4000 | $this->id;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->data = $this->data;
return $pk;
}
}

View File

@ -21,43 +21,10 @@
namespace pocketmine\level\particle;
use pocketmine\entity\Entity;
use pocketmine\entity\Wolf;
use pocketmine\math\Vector3;
use pocketmine\network\protocol\AddMobPacket;
use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\network\protocol\RemoveEntityPacket;
class HeartParticle extends Particle{
//TODO: HACK!
//TODO: needs more testing!
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z);
}
public function encode(){
$entityId = bcadd("1095216660480", mt_rand(0, 0x7fffffff)); //No conflict with other things
$pk = new AddMobPacket();
$pk->eid = $entityId;
$pk->type = Wolf::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y - 1;
$pk->z = $this->z;
$pk->pitch = 0;
$pk->yaw = 0;
$pk->metadata = [
Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE],
Entity::DATA_AIR => [Entity::DATA_TYPE_SHORT, 300]
];
$pk2 = new EntityEventPacket();
$pk2->eid = $entityId;
$pk2->event = 7;
$pk3 = new RemoveEntityPacket();
$pk3->eid = $entityId;
return [$pk, $pk2, $pk3];
class HeartParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
parent::__construct($pos->x, $pos->y, $pos->z, 14, $scale);
}
}

View File

@ -0,0 +1,73 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\entity\Entity;
use pocketmine\entity\Wolf;
use pocketmine\math\Vector3;
use pocketmine\network\protocol\AddMobPacket;
use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\network\protocol\RemoveEntityPacket;
class InkCloudParticle extends Particle{
//TODO: HACK!
protected $count = 1;
public function __construct(Vector3 $pos, $count = 1){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->count = (int) $count;
}
public function encode(){
$p = [];
$entityId = bcadd("1095216660480", mt_rand(0, 0x7fffffff)); //No conflict with other things
$pk = new AddMobPacket();
$pk->eid = $entityId;
$pk->type = 17;
$pk->x = $this->x;
$pk->y = $this->y - 1;
$pk->z = $this->z;
$pk->pitch = 0;
$pk->yaw = 0;
$pk->metadata = [
Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE],
Entity::DATA_AIR => [Entity::DATA_TYPE_SHORT, 300]
];
$p[] = $pk;
for($i = 0; $i < $this->count; ++$i){
$pk2 = new EntityEventPacket();
$pk2->eid = $entityId;
$pk2->event = 15;
$p[] = $pk2;
}
$pk3 = new RemoveEntityPacket();
$pk3->eid = $entityId;
$p[] = $pk3;
return $p;
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class InkParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
parent::__construct($pos->x, $pos->y, $pos->z, 25, $scale);
}
}

View File

@ -0,0 +1,31 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
use pocketmine\item\Item;
class ItemBreakParticle extends GenericParticle{
public function __construct(Vector3 $pos, Item $item){
parent::__construct($pos->x, $pos->y, $pos->z, 9, ($item->getId() << 16) | $item->getDamage());
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class LavaDripParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 21);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class LavaParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 6);
}
}

View File

@ -0,0 +1,73 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\entity\Entity;
use pocketmine\entity\Wolf;
use pocketmine\math\Vector3;
use pocketmine\network\protocol\AddMobPacket;
use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\network\protocol\RemoveEntityPacket;
class MateFailParticle extends Particle{
//TODO: HACK!
protected $count = 1;
public function __construct(Vector3 $pos, $count = 1){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->count = (int) $count;
}
public function encode(){
$p = [];
$entityId = bcadd("1095216660480", mt_rand(0, 0x7fffffff)); //No conflict with other things
$pk = new AddMobPacket();
$pk->eid = $entityId;
$pk->type = Wolf::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y - 1;
$pk->z = $this->z;
$pk->pitch = 0;
$pk->yaw = 0;
$pk->metadata = [
Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE],
Entity::DATA_AIR => [Entity::DATA_TYPE_SHORT, 300]
];
$p[] = $pk;
for($i = 0; $i < $this->count; ++$i){
$pk2 = new EntityEventPacket();
$pk2->eid = $entityId;
$pk2->event = 6;
$p[] = $pk2;
}
$pk3 = new RemoveEntityPacket();
$pk3->eid = $entityId;
$p[] = $pk3;
return $p;
}
}

View File

@ -0,0 +1,73 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\entity\Entity;
use pocketmine\entity\Wolf;
use pocketmine\math\Vector3;
use pocketmine\network\protocol\AddMobPacket;
use pocketmine\network\protocol\EntityEventPacket;
use pocketmine\network\protocol\RemoveEntityPacket;
class MateParticle extends Particle{
//TODO: HACK!
protected $count = 1;
public function __construct(Vector3 $pos, $count = 1){
parent::__construct($pos->x, $pos->y, $pos->z);
$this->count = (int) $count;
}
public function encode(){
$p = [];
$entityId = bcadd("1095216660480", mt_rand(0, 0x7fffffff)); //No conflict with other things
$pk = new AddMobPacket();
$pk->eid = $entityId;
$pk->type = Wolf::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y - 1;
$pk->z = $this->z;
$pk->pitch = 0;
$pk->yaw = 0;
$pk->metadata = [
Entity::DATA_FLAGS => [Entity::DATA_TYPE_BYTE, 1 << Entity::DATA_FLAG_INVISIBLE],
Entity::DATA_AIR => [Entity::DATA_TYPE_SHORT, 300]
];
$p[] = $pk;
for($i = 0; $i < $this->count; ++$i){
$pk2 = new EntityEventPacket();
$pk2->eid = $entityId;
$pk2->event = 7;
$p[] = $pk2;
}
$pk3 = new RemoveEntityPacket();
$pk3->eid = $entityId;
$p[] = $pk3;
return $p;
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class PortalParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 17);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class RedstoneParticle extends GenericParticle{
public function __construct(Vector3 $pos, $lifetime = 1){
parent::__construct($pos->x, $pos->y, $pos->z, 8, $lifetime);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class SmokeParticle extends GenericParticle{
public function __construct(Vector3 $pos, $scale = 0){
parent::__construct($pos->x, $pos->y, $pos->z, 3, (int) $scale);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class SplashParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 18);
}
}

View File

@ -0,0 +1,31 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\block\Block;
use pocketmine\math\Vector3;
class TerrainParticle extends GenericParticle{
public function __construct(Vector3 $pos, Block $b){
parent::__construct($pos->x, $pos->y, $pos->z, 15, ($b->getId() << 8) | $b->getDamage());
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class WaterDripParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 20);
}
}

View File

@ -0,0 +1,30 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\level\particle;
use pocketmine\math\Vector3;
class WaterParticle extends GenericParticle{
public function __construct(Vector3 $pos){
parent::__construct($pos->x, $pos->y, $pos->z, 19);
}
}

View File

@ -45,9 +45,9 @@ class LevelEventPacket extends DataPacket{
public function encode(){
$this->reset();
$this->putShort($this->evid);
$this->putInt($this->x);
$this->putByte($this->y);
$this->putInt($this->z);
$this->putFloat($this->x);
$this->putFloat($this->y);
$this->putFloat($this->z);
$this->putInt($this->data);
}