DaPigGuy / PiggyCustomEnchants

An open source custom enchantment plugin for PocketMine-MP
https://piggydocs.aericio.net/PiggyCustomEnchants.html
Apache License 2.0
103 stars 118 forks source link

Plugin Make My Server Crash Always Restart! #345

Closed ItzFel closed 2 years ago

ItzFel commented 3 years ago

Error: Invalid argument supplied for foreach() File: plugins/PiggyCustomEnchants (1).phar/src/DaPigGuy/PiggyCustomEnchants/tasks/CheckDisabledEnchantsTask Line: 27 Type: ErrorException

THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: PiggyCustomEnchants v2.4.0

Code: [18] if ($disabledEnchants !== false) $this->setResult($disabledEnchants); [19] } [20] [21] public function onCompletion(Server $server): void [22] { [23] if ($this->getResult() !== null) { [24] $plugin = CustomEnchantManager::getPlugin(); [25] if ($plugin->isEnabled()) { [26] $disabledEnchants = json_decode($this->getResult(), true); [27] foreach ($disabledEnchants as $disabledEnchantEntry) { [28] if ( [29] count(array_intersect($disabledEnchantEntry["api"], $plugin->getDescription()->getCompatibleApis())) > 0 || [30] in_array("all", $disabledEnchantEntry["api"]) || [31] in_array($plugin->getDescription()->getVersion(), $disabledEnchantEntry["version"]) || [32] in_array("all", $disabledEnchantEntry["version"]) [33] ) { [34] $plugin->getLogger()->info("Enchantment " . $disabledEnchantEntry["name"] . " (id " . $disabledEnchantEntry["id"] . ") has been remotely disabled for " . $disabledEnchantEntry["reason"]); [35] CustomEnchantManager::unregisterEnchantment($disabledEnchantEntry["id"]); [36] } [37] }

If i delete this plugin, my server cant start..

MrNinja008 commented 3 years ago

Same problem and error pls help! @DaPigGuy @Aericio

Aericio commented 3 years ago

does this problem still occur

DaPigGuy commented 2 years ago

Likely fixed in #369