Closed jarne closed 2 years ago
[11:35:48.645] [Server thread/CRITICAL]: ArgumentCountError: "Expected exactly 0 arguments, 1 passed" (EXCEPTION) in "pmsrc/src/utils/RegistryTrait" at line 91 --- Stack trace --- #0 plugins/HotBlock-master/src/surva/hotblock/tasks/PlayerBlockCheckTask(50): pocketmine\entity\effect\VanillaEffects::__callStatic(string[10] fromString, array[1]) #1 pmsrc/src/scheduler/TaskHandler(117): surva\hotblock\tasks\PlayerBlockCheckTask->onRun() #2 pmsrc/src/scheduler/TaskScheduler(141): pocketmine\scheduler\TaskHandler->run() #3 pmsrc/src/plugin/PluginManager(466): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 116) #4 pmsrc/src/Server(1768): pocketmine\plugin\PluginManager->tickSchedulers(integer 116) #5 pmsrc/src/Server(1657): pocketmine\Server->tick() #6 pmsrc/src/Server(1046): pocketmine\Server->tickProcessor() #7 pmsrc/src/PocketMine(304): pocketmine\Server->__construct(object BaseClassLoader#2, object pocketmine\utils\MainLogger#3, string[27] /Users/jarne/PocketMine-MP/, string[35] /Users/jarne/PocketMine-MP/plugins/) #8 pmsrc/src/PocketMine(327): pocketmine\server() #9 pmsrc(11): require(string[71] phar:///Users/jarne/PocketMine-MP/PocketMine-MP.phar/src/PocketMine.php) --- End of exception information ---
Might be related to this line? https://github.com/pmmp/PocketMine-MP/blob/stable/src/utils/RegistryTrait.php#L90 ... which throws an exception when calling the method public static function fromString(string $name) : Effect{ of VanillaEffects.
public static function fromString(string $name) : Effect{
$effect = VanillaEffects::fromString("poison");
https://crash.pmmp.io/view/6002153
VanillaEffect doesn't have fromString method. You're supposed to use StringToEffectParser instead.
VanillaEffect
fromString
You're right, my PMMP sources weren't up to date, thank you 👍
Issue description
Might be related to this line? https://github.com/pmmp/PocketMine-MP/blob/stable/src/utils/RegistryTrait.php#L90 ... which throws an exception when calling the method
public static function fromString(string $name) : Effect{
of VanillaEffects.Steps to reproduce the issue
$effect = VanillaEffects::fromString("poison");
OS and versions
Plugins
Crashdump, backtrace or other files
https://crash.pmmp.io/view/6002153