Enchantment: use Translatable instead of hardcoded translation keys

This commit is contained in:
Dylan K. Taylor
2021-09-03 20:52:05 +01:00
parent fbbaef4401
commit aa5a9f6d12
7 changed files with 212 additions and 24 deletions

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\item\enchantment;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\lang\Translatable;
use function array_flip;
use function floor;
@@ -38,7 +39,7 @@ class ProtectionEnchantment extends Enchantment{
*
* @param int[]|null $applicableDamageTypes EntityDamageEvent::CAUSE_* constants which this enchantment type applies to, or null if it applies to all types of damage.
*/
public function __construct(int $internalRuntimeId, string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes){
public function __construct(int $internalRuntimeId, Translatable|string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes){
parent::__construct($internalRuntimeId, $name, $rarity, $primaryItemFlags, $secondaryItemFlags, $maxLevel);
$this->typeModifier = $typeModifier;