TNT now ignites when hit by a burning projectile

This commit is contained in:
Dylan K. Taylor 2022-07-14 00:12:02 +01:00
parent eafc23c756
commit d0067cfac5
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -29,10 +29,12 @@ use pocketmine\entity\Entity;
use pocketmine\entity\Location;
use pocketmine\entity\object\PrimedTNT;
use pocketmine\entity\projectile\Arrow;
use pocketmine\entity\projectile\Projectile;
use pocketmine\item\Durable;
use pocketmine\item\enchantment\VanillaEnchantments;
use pocketmine\item\FlintSteel;
use pocketmine\item\Item;
use pocketmine\math\RayTraceResult;
use pocketmine\math\Vector3;
use pocketmine\player\Player;
use pocketmine\utils\Random;
@ -138,4 +140,10 @@ class TNT extends Opaque{
public function onIncinerate() : void{
$this->ignite();
}
public function onProjectileHit(Projectile $projectile, RayTraceResult $hitResult) : void{
if($projectile->isOnFire()){
$this->ignite();
}
}
}