PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
StringToEnchantmentParser.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
24namespace pocketmine\item\enchantment;
25
26use pocketmine\utils\SingletonTrait;
28
35 use SingletonTrait;
36
37 private static function make() : self{
38 $result = new self();
39
40 $result->register("blast_protection", fn() => VanillaEnchantments::BLAST_PROTECTION());
41 $result->register("efficiency", fn() => VanillaEnchantments::EFFICIENCY());
42 $result->register("feather_falling", fn() => VanillaEnchantments::FEATHER_FALLING());
43 $result->register("fire_aspect", fn() => VanillaEnchantments::FIRE_ASPECT());
44 $result->register("fire_protection", fn() => VanillaEnchantments::FIRE_PROTECTION());
45 $result->register("flame", fn() => VanillaEnchantments::FLAME());
46 $result->register("fortune", fn() => VanillaEnchantments::FORTUNE());
47 $result->register("frost_walker", fn() => VanillaEnchantments::FROST_WALKER());
48 $result->register("infinity", fn() => VanillaEnchantments::INFINITY());
49 $result->register("knockback", fn() => VanillaEnchantments::KNOCKBACK());
50 $result->register("mending", fn() => VanillaEnchantments::MENDING());
51 $result->register("power", fn() => VanillaEnchantments::POWER());
52 $result->register("projectile_protection", fn() => VanillaEnchantments::PROJECTILE_PROTECTION());
53 $result->register("protection", fn() => VanillaEnchantments::PROTECTION());
54 $result->register("punch", fn() => VanillaEnchantments::PUNCH());
55 $result->register("respiration", fn() => VanillaEnchantments::RESPIRATION());
56 $result->register("aqua_affinity", fn() => VanillaEnchantments::AQUA_AFFINITY());
57 $result->register("sharpness", fn() => VanillaEnchantments::SHARPNESS());
58 $result->register("silk_touch", fn() => VanillaEnchantments::SILK_TOUCH());
59 $result->register("swift_sneak", fn() => VanillaEnchantments::SWIFT_SNEAK());
60 $result->register("thorns", fn() => VanillaEnchantments::THORNS());
61 $result->register("unbreaking", fn() => VanillaEnchantments::UNBREAKING());
62 $result->register("vanishing", fn() => VanillaEnchantments::VANISHING());
63
64 return $result;
65 }
66
67 public function parse(string $input) : ?Enchantment{
68 return parent::parse($input);
69 }
70}