PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
Loading...
Searching...
No Matches
StringToEffectParser.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\entity\effect;
25
26use pocketmine\utils\SingletonTrait;
28
35 use SingletonTrait;
36
37 private static function make() : self{
38 $result = new self();
39
40 $result->register("absorption", fn() => VanillaEffects::ABSORPTION());
41 $result->register("blindness", fn() => VanillaEffects::BLINDNESS());
42 $result->register("conduit_power", fn() => VanillaEffects::CONDUIT_POWER());
43 $result->register("darkness", fn() => VanillaEffects::DARKNESS());
44 $result->register("fatal_poison", fn() => VanillaEffects::FATAL_POISON());
45 $result->register("fire_resistance", fn() => VanillaEffects::FIRE_RESISTANCE());
46 $result->register("haste", fn() => VanillaEffects::HASTE());
47 $result->register("health_boost", fn() => VanillaEffects::HEALTH_BOOST());
48 $result->register("hunger", fn() => VanillaEffects::HUNGER());
49 $result->register("instant_damage", fn() => VanillaEffects::INSTANT_DAMAGE());
50 $result->register("instant_health", fn() => VanillaEffects::INSTANT_HEALTH());
51 $result->register("invisibility", fn() => VanillaEffects::INVISIBILITY());
52 $result->register("jump_boost", fn() => VanillaEffects::JUMP_BOOST());
53 $result->register("levitation", fn() => VanillaEffects::LEVITATION());
54 $result->register("mining_fatigue", fn() => VanillaEffects::MINING_FATIGUE());
55 $result->register("nausea", fn() => VanillaEffects::NAUSEA());
56 $result->register("night_vision", fn() => VanillaEffects::NIGHT_VISION());
57 $result->register("poison", fn() => VanillaEffects::POISON());
58 $result->register("regeneration", fn() => VanillaEffects::REGENERATION());
59 $result->register("resistance", fn() => VanillaEffects::RESISTANCE());
60 $result->register("saturation", fn() => VanillaEffects::SATURATION());
61 $result->register("slowness", fn() => VanillaEffects::SLOWNESS());
62 $result->register("speed", fn() => VanillaEffects::SPEED());
63 $result->register("strength", fn() => VanillaEffects::STRENGTH());
64 $result->register("water_breathing", fn() => VanillaEffects::WATER_BREATHING());
65 $result->register("weakness", fn() => VanillaEffects::WEAKNESS());
66 $result->register("wither", fn() => VanillaEffects::WITHER());
67
68 return $result;
69 }
70
71 public function parse(string $input) : ?Effect{
72 return parent::parse($input);
73 }
74}