mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Effect: get rid of runtimeIDs
This commit is contained in:
@ -27,32 +27,26 @@ use pocketmine\color\Color;
|
||||
use pocketmine\entity\Entity;
|
||||
use pocketmine\entity\Living;
|
||||
use pocketmine\lang\Translatable;
|
||||
use pocketmine\utils\NotCloneable;
|
||||
use pocketmine\utils\NotSerializable;
|
||||
|
||||
class Effect{
|
||||
use NotCloneable;
|
||||
use NotSerializable;
|
||||
|
||||
/**
|
||||
* @param int $internalRuntimeId Internal runtime ID, unique to this effect type. Used for comparisons.
|
||||
* @param Translatable|string $name Translation key used for effect name
|
||||
* @param Color $color Color of bubbles given by this effect
|
||||
* @param bool $bad Whether the effect is harmful
|
||||
* @param bool $hasBubbles Whether the effect has potion bubbles. Some do not (e.g. Instant Damage has its own particles instead of bubbles)
|
||||
*/
|
||||
public function __construct(
|
||||
protected int $internalRuntimeId,
|
||||
protected Translatable|string $name,
|
||||
protected Color $color,
|
||||
protected bool $bad = false,
|
||||
protected bool $hasBubbles = true
|
||||
){}
|
||||
|
||||
/**
|
||||
* Returns a unique identifier for this effect type
|
||||
* WARNING: DO NOT STORE THIS - IT MAY CHANGE BETWEEN RESTARTS
|
||||
*/
|
||||
public function getRuntimeId() : int{
|
||||
return $this->internalRuntimeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the translation key used to translate this effect's name.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user