Moved enchantment ID handling to pocketmine/data/bedrock package

this permits plugins to register their own enchantments mapped to MCPE IDs again.
This commit is contained in:
Dylan K. Taylor
2020-10-24 17:59:46 +01:00
parent 2e1239f77a
commit 47976bac34
8 changed files with 153 additions and 35 deletions

View File

@@ -38,8 +38,8 @@ 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 $id, string $name, int $rarity, int $primaryItemFlags, int $secondaryItemFlags, int $maxLevel, float $typeModifier, ?array $applicableDamageTypes){
parent::__construct($id, $name, $rarity, $primaryItemFlags, $secondaryItemFlags, $maxLevel);
public function __construct(int $internalRuntimeId, 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;
if($applicableDamageTypes !== null){