Fixed TNT broadcasting ignition sound (#3996)

closes #3952
This commit is contained in:
Mohamed 2021-01-07 22:18:18 +01:00 committed by GitHub
parent 82c8fa696a
commit 5392ddf0b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -34,6 +34,7 @@ use pocketmine\item\Item;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\player\Player; use pocketmine\player\Player;
use pocketmine\utils\Random; use pocketmine\utils\Random;
use pocketmine\world\sound\IgniteSound;
use function cos; use function cos;
use function sin; use function sin;
use const M_PI; use const M_PI;
@ -101,6 +102,7 @@ class TNT extends Opaque{
$tnt->setMotion(new Vector3(-sin($mot) * 0.02, 0.2, -cos($mot) * 0.02)); $tnt->setMotion(new Vector3(-sin($mot) * 0.02, 0.2, -cos($mot) * 0.02));
$tnt->spawnToAll(); $tnt->spawnToAll();
$tnt->broadcastSound(new IgniteSound());
} }
public function getFlameEncouragement() : int{ public function getFlameEncouragement() : int{

View File

@ -35,7 +35,6 @@ use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataFlags;
use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties; use pocketmine\network\mcpe\protocol\types\entity\EntityMetadataProperties;
use pocketmine\world\Explosion; use pocketmine\world\Explosion;
use pocketmine\world\Position; use pocketmine\world\Position;
use pocketmine\world\sound\IgniteSound;
class PrimedTNT extends Entity implements Explosive{ class PrimedTNT extends Entity implements Explosive{
@ -73,8 +72,6 @@ class PrimedTNT extends Entity implements Explosive{
parent::initEntity($nbt); parent::initEntity($nbt);
$this->fuse = $nbt->getShort("Fuse", 80); $this->fuse = $nbt->getShort("Fuse", 80);
$this->broadcastSound(new IgniteSound());
} }
public function canCollideWith(Entity $entity) : bool{ public function canCollideWith(Entity $entity) : bool{