mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Move Event cancellable parts to trait
This commit is contained in:
@ -25,6 +25,7 @@ namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
|
||||
@ -32,6 +33,8 @@ use pocketmine\Player;
|
||||
* Called when a player destroys a block somewhere in the world.
|
||||
*/
|
||||
class BlockBreakEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Player */
|
||||
protected $player;
|
||||
|
||||
|
@ -25,11 +25,14 @@ namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when a block is burned away by fire.
|
||||
*/
|
||||
class BlockBurnEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Block */
|
||||
private $causingBlock;
|
||||
|
||||
|
@ -25,11 +25,14 @@ namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when plants or crops grow.
|
||||
*/
|
||||
class BlockGrowEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Block */
|
||||
private $newState;
|
||||
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\Player;
|
||||
|
||||
@ -32,6 +33,8 @@ use pocketmine\Player;
|
||||
* Called when a player places a block
|
||||
*/
|
||||
class BlockPlaceEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Player */
|
||||
protected $player;
|
||||
|
||||
|
@ -24,10 +24,11 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when a block tries to be updated due to a neighbor change
|
||||
*/
|
||||
class BlockUpdateEvent extends BlockEvent implements Cancellable{
|
||||
|
||||
use CancellableTrait;
|
||||
}
|
||||
|
@ -24,10 +24,11 @@ declare(strict_types=1);
|
||||
namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
|
||||
/**
|
||||
* Called when leaves decay due to not being attached to wood.
|
||||
*/
|
||||
class LeavesDecayEvent extends BlockEvent implements Cancellable{
|
||||
|
||||
use CancellableTrait;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ namespace pocketmine\event\block;
|
||||
|
||||
use pocketmine\block\Block;
|
||||
use pocketmine\event\Cancellable;
|
||||
use pocketmine\event\CancellableTrait;
|
||||
use pocketmine\Player;
|
||||
use function count;
|
||||
|
||||
@ -32,6 +33,8 @@ use function count;
|
||||
* Called when a sign is changed by a player.
|
||||
*/
|
||||
class SignChangeEvent extends BlockEvent implements Cancellable{
|
||||
use CancellableTrait;
|
||||
|
||||
/** @var Player */
|
||||
private $player;
|
||||
/** @var string[] */
|
||||
|
Reference in New Issue
Block a user