Introduced VanillaEnchantments registry

This commit is contained in:
Dylan K. Taylor
2020-10-23 20:48:19 +01:00
parent e9038336e3
commit a01c086481
16 changed files with 191 additions and 204 deletions

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\item\enchantment\Enchantment;
use pocketmine\item\enchantment\VanillaEnchantments;
abstract class Tool extends Durable{
@@ -35,7 +35,7 @@ abstract class Tool extends Durable{
$efficiency = 1;
if($isCorrectTool){
$efficiency = $this->getBaseMiningEfficiency();
if(($enchantmentLevel = $this->getEnchantmentLevel(Enchantment::EFFICIENCY())) > 0){
if(($enchantmentLevel = $this->getEnchantmentLevel(VanillaEnchantments::EFFICIENCY())) > 0){
$efficiency += ($enchantmentLevel ** 2 + 1);
}
}