mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
Introduced VanillaEnchantments registry
This commit is contained in:
@@ -27,6 +27,7 @@ use pocketmine\command\CommandSender;
|
||||
use pocketmine\command\utils\InvalidCommandSyntaxException;
|
||||
use pocketmine\item\enchantment\Enchantment;
|
||||
use pocketmine\item\enchantment\EnchantmentInstance;
|
||||
use pocketmine\item\enchantment\VanillaEnchantments;
|
||||
use pocketmine\lang\TranslationContainer;
|
||||
use pocketmine\utils\TextFormat;
|
||||
use function count;
|
||||
@@ -67,9 +68,9 @@ class EnchantCommand extends VanillaCommand{
|
||||
}
|
||||
|
||||
if(is_numeric($args[1])){
|
||||
$enchantment = Enchantment::get((int) $args[1]);
|
||||
$enchantment = VanillaEnchantments::byMcpeId((int) $args[1]);
|
||||
}else{
|
||||
$enchantment = Enchantment::fromString($args[1]);
|
||||
$enchantment = VanillaEnchantments::fromString($args[1]);
|
||||
}
|
||||
|
||||
if(!($enchantment instanceof Enchantment)){
|
||||
|
Reference in New Issue
Block a user