Merge commit '22b5de09b476a8c1638adfaba56b210c1eb1faf0'

# Conflicts:
#	resources/vanilla
#	src/pocketmine/level/particle/InstantEnchantParticle.php
#	src/world/sound/ExplodeSound.php
This commit is contained in:
Dylan K. Taylor 2020-05-18 20:30:00 +01:00
commit 232ff838db
2 changed files with 10 additions and 2 deletions

View File

@ -156,7 +156,7 @@ class ParticleCommand extends VanillaCommand{
case "smoke":
return new SmokeParticle($data ?? 0);
case "spell":
return new EnchantParticle();
return new EnchantParticle(new Color(0, 0, 0, 255)); //TODO: colour support
case "instantspell":
return new InstantEnchantParticle(new Color(0, 0, 0, 255)); //TODO: colour support
case "dripwater":

View File

@ -23,13 +23,21 @@ declare(strict_types=1);
namespace pocketmine\world\particle;
use pocketmine\color\Color;
use pocketmine\math\Vector3;
use pocketmine\network\mcpe\protocol\LevelEventPacket;
use pocketmine\network\mcpe\protocol\types\ParticleIds;
class EnchantParticle implements Particle{
/** @var Color */
private $color;
public function __construct(Color $color){
$this->color = $color;
}
public function encode(Vector3 $pos){
return LevelEventPacket::standardParticle(ParticleIds::MOB_SPELL, 0, $pos);
return LevelEventPacket::standardParticle(ParticleIds::MOB_SPELL, $this->color->toARGB(), $pos);
}
}