-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
194 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2024 AIPTU | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/AIPTU/Smaccer | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace aiptu\smaccer\event; | ||
|
||
use pocketmine\entity\Entity; | ||
use pocketmine\event\Cancellable; | ||
use pocketmine\event\CancellableTrait; | ||
use pocketmine\event\player\PlayerEvent; | ||
use pocketmine\player\Player; | ||
|
||
class NPCAttackEvent extends PlayerEvent implements Cancellable { | ||
use CancellableTrait; | ||
|
||
public function __construct( | ||
protected Player $player, | ||
private Entity $entity, | ||
) {} | ||
|
||
public function getEntity() : Entity { | ||
return $this->entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2024 AIPTU | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/AIPTU/Smaccer | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace aiptu\smaccer\event; | ||
|
||
use pocketmine\entity\Entity; | ||
use pocketmine\event\entity\EntityEvent; | ||
|
||
/** | ||
* @phpstan-extends EntityEvent<Entity> | ||
*/ | ||
class NPCDespawnEvent extends EntityEvent { | ||
public function __construct(protected Entity $entity) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2024 AIPTU | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/AIPTU/Smaccer | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace aiptu\smaccer\event; | ||
|
||
use pocketmine\entity\Entity; | ||
use pocketmine\event\Cancellable; | ||
use pocketmine\event\CancellableTrait; | ||
use pocketmine\event\player\PlayerEvent; | ||
use pocketmine\player\Player; | ||
|
||
class NPCInteractEvent extends PlayerEvent implements Cancellable { | ||
use CancellableTrait; | ||
|
||
public function __construct( | ||
protected Player $player, | ||
private Entity $entity, | ||
) {} | ||
|
||
public function getEntity() : Entity { | ||
return $this->entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2024 AIPTU | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/AIPTU/Smaccer | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace aiptu\smaccer\event; | ||
|
||
use pocketmine\entity\Entity; | ||
use pocketmine\event\entity\EntityEvent; | ||
|
||
/** | ||
* @phpstan-extends EntityEvent<Entity> | ||
*/ | ||
class NPCSpawnEvent extends EntityEvent { | ||
public function __construct(protected Entity $entity) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) 2024 AIPTU | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/AIPTU/Smaccer | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace aiptu\smaccer\event; | ||
|
||
use aiptu\smaccer\entity\NPCData; | ||
use pocketmine\entity\Entity; | ||
use pocketmine\event\Cancellable; | ||
use pocketmine\event\CancellableTrait; | ||
use pocketmine\event\entity\EntityEvent; | ||
|
||
/** | ||
* @phpstan-extends EntityEvent<Entity> | ||
*/ | ||
class NPCUpdateEvent extends EntityEvent implements Cancellable { | ||
use CancellableTrait; | ||
|
||
public function __construct( | ||
protected Entity $entity, | ||
protected NPCData $npcData | ||
) {} | ||
|
||
public function getNPCData() : NPCData { | ||
return $this->npcData; | ||
} | ||
|
||
public function setNPCData(NPCData $npcData) : void { | ||
$this->npcData = $npcData; | ||
} | ||
} |