Effect: get rid of runtimeIDs

This commit is contained in:
Dylan K. Taylor
2021-09-03 21:25:06 +01:00
parent c062282954
commit 0404298c74
5 changed files with 41 additions and 45 deletions

View File

@ -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.
*/