XanderID / EconomyEnchant

a EconomyEnchant Shop in UI or GUI, With Many Features
MIT License
5 stars 5 forks source link

there was an error running the server #8

Closed sirut1702 closed 1 year ago

sirut1702 commented 1 year ago

THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: EconomyEnchant

Error: Call to undefined method pocketmine\item\enchantment\Enchantment::getId() File: plugins/EconomyEnchant-main/src/XanderID/EconomyEnchant/EconomyEnchant Line: 326 Type: Error Backtrace:

0 plugins/EconomyEnchant-main/src/XanderID/EconomyEnchant/EconomyEnchant(93): XanderID\EconomyEnchant\EconomyEnchant->registerVanillaCEnchant(true)

1 pmsrc/src/plugin/PluginBase(118): XanderID\EconomyEnchant\EconomyEnchant->onEnable()

2 pmsrc/src/plugin/PluginManager(454): pocketmine\plugin\PluginBase->onEnableStateChange(true)

3 pmsrc/src/Server(1414): pocketmine\plugin\PluginManager->enablePlugin(object XanderID\EconomyEnchant\EconomyEnchant#29341)

4 pmsrc/src/Server(1025): pocketmine\Server->enablePlugins(object pocketmine\plugin\PluginEnableOrder#21942)

5 pmsrc/src/PocketMine(339): pocketmine\Server->__construct(object BaseClassLoader#5, object pocketmine\utils\MainLogger#2, string[16] /home/container/, string[24] /home/container/plugins/)

6 pmsrc/src/PocketMine(362): pocketmine\server()

7 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)

Code: [317] $all = [ [318] EnchantmentIds::BANE_OF_ARTHROPODS => $encmap->fromId(EnchantmentIds::BANE_OF_ARTHROPODS), [319] EnchantmentIds::LOOTING => $encmap->fromId(EnchantmentIds::LOOTING), [320] EnchantmentIds::FORTUNE => $encmap->fromId(EnchantmentIds::FORTUNE), [321] EnchantmentIds::SMITE => $encmap->fromId(EnchantmentIds::SMITE) [322] ]; [323] [324] // add only if not Blacklisted [325] foreach ($all as $id => $enchant) { [326] $name = strtolower(strreplace(" ", "", $enchant->getId())); // Replace space name with underline [327] [328] // Display name for Button [329] // _ replaced to space [330] $display = strreplace("", " ", $name); [331] $displayname = ucwords(strtolower($display)); [332] [333] // Getting price and pass if the mode is false and the price is not set [334] $price = EnchantManager::getPriceInConfig($name); [335] if($price == null){ [336] if(!$mode) continue;