PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
Effect.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\entity\effect;
25
30use pocketmine\utils\NotCloneable;
31use pocketmine\utils\NotSerializable;
32
33class Effect{
34 use NotCloneable;
35 use NotSerializable;
36
43 public function __construct(
44 protected Translatable|string $name,
45 protected Color $color,
46 protected bool $bad = false,
47 private int $defaultDuration = 600,
48 protected bool $hasBubbles = true
49 ){}
50
54 public function getName() : Translatable|string{
55 return $this->name;
56 }
57
61 public function getColor() : Color{
62 return $this->color;
63 }
64
69 public function isBad() : bool{
70 return $this->bad;
71 }
72
76 public function getDefaultDuration() : int{
77 return $this->defaultDuration;
78 }
79
83 public function hasBubbles() : bool{
84 return $this->hasBubbles;
85 }
86
90 public function canTick(EffectInstance $instance) : bool{
91 return false;
92 }
93
97 public function applyEffect(Living $entity, EffectInstance $instance, float $potency = 1.0, ?Entity $source = null) : void{
98
99 }
100
104 public function add(Living $entity, EffectInstance $instance) : void{
105
106 }
107
111 public function remove(Living $entity, EffectInstance $instance) : void{
112
113 }
114}
__construct(protected Translatable|string $name, protected Color $color, protected bool $bad=false, private int $defaultDuration=600, protected bool $hasBubbles=true)
Definition Effect.php:43
applyEffect(Living $entity, EffectInstance $instance, float $potency=1.0, ?Entity $source=null)
Definition Effect.php:97
canTick(EffectInstance $instance)
Definition Effect.php:90