Rename ExplosionPrimeEvent to EntityPreExplodeEvent (#5434)

This commit is contained in:
zSALLAZAR 2022-11-26 20:55:16 +01:00 committed by GitHub
parent b0c6e8d8e0
commit 8f20b9da91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -27,7 +27,7 @@ use pocketmine\entity\Entity;
use pocketmine\entity\EntitySizeInfo; use pocketmine\entity\EntitySizeInfo;
use pocketmine\entity\Explosive; use pocketmine\entity\Explosive;
use pocketmine\event\entity\EntityDamageEvent; use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\ExplosionPrimeEvent; use pocketmine\event\entity\EntityPreExplodeEvent;
use pocketmine\math\Vector3; use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\CompoundTag;
use pocketmine\network\mcpe\protocol\types\entity\EntityIds; use pocketmine\network\mcpe\protocol\types\entity\EntityIds;
@ -113,7 +113,7 @@ class PrimedTNT extends Entity implements Explosive{
} }
public function explode() : void{ public function explode() : void{
$ev = new ExplosionPrimeEvent($this, 4); $ev = new EntityPreExplodeEvent($this, 4);
$ev->call(); $ev->call();
if(!$ev->isCancelled()){ if(!$ev->isCancelled()){
//TODO: deal with underwater TNT (underwater TNT treats water as if it has a blast resistance of 0) //TODO: deal with underwater TNT (underwater TNT treats water as if it has a blast resistance of 0)

View File

@ -34,7 +34,7 @@ use pocketmine\world\Position;
* Called when an entity explodes, after the explosion's impact has been calculated. * Called when an entity explodes, after the explosion's impact has been calculated.
* No changes have been made to the world at this stage. * No changes have been made to the world at this stage.
* *
* @see ExplosionPrimeEvent * @see EntityPreExplodeEvent
* *
* @phpstan-extends EntityEvent<Entity> * @phpstan-extends EntityEvent<Entity>
*/ */

View File

@ -35,7 +35,7 @@ use pocketmine\event\CancellableTrait;
* *
* @phpstan-extends EntityEvent<Entity> * @phpstan-extends EntityEvent<Entity>
*/ */
class ExplosionPrimeEvent extends EntityEvent implements Cancellable{ class EntityPreExplodeEvent extends EntityEvent implements Cancellable{
use CancellableTrait; use CancellableTrait;
private bool $blockBreaking = true; private bool $blockBreaking = true;