Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molten: Call to a member function getContents() on null #237

Closed
RubyTemple opened this issue Jan 4, 2020 · 0 comments · Fixed by #240
Closed

Molten: Call to a member function getContents() on null #237

RubyTemple opened this issue Jan 4, 2020 · 0 comments · Fixed by #240

Comments

@RubyTemple
Copy link
Contributor

RubyTemple commented Jan 4, 2020

Please make sure your issue complies with these guidelines:

    • Server Software must be the official PMMP w/o vanilla patching plugins (i.e. TeaSpoon)
    • Issue must have not been reported previously
    • Make sure you are on the latest version of PMMP & PiggyCustomEnchants
    • Have a detailed title, like "CustomEnchants::getName() must be..."
    • If possible, provide crashdumps/errors related to the issue.

General

Server Crash

Version:

  • PiggyCustomEnchants: 2.0.3
  • PMMP: 3.11.2

Steps to Reproduce the Issue

  1. idk

Extra Information

PocketMine-MP Crash Dump Sat Jan 4 16:49:46 CET 2020

Error: Call to a member function getContents() on null
File: src/pocketmine/entity/Living
Line: 439
Type: Error

A PLUGIN WAS INVOLVED IN THIS CRASH
BAD PLUGIN: PiggyCustomEnchants v2.0.3

Code:
[430] 	/**
[431] 	 * Returns the highest level of the specified enchantment on any armour piece that the entity is currently wearing.
[432] 	 *
[433] 	 * @param int $enchantmentId
[434] 	 *
[435] 	 * @return int
[436] 	 */
[437] 	public function getHighestArmorEnchantmentLevel(int $enchantmentId) : int{
[438] 		$result = 0;
[439] 		foreach($this->armorInventory->getContents() as $item){
[440] 			$result = max($result, $item->getEnchantmentLevel($enchantmentId));
[441] 		}
[442] 
[443] 		return $result;
[444] 	}
[445] 
[446] 	/**
[447] 	 * @return ArmorInventory
[448] 	 */
[449] 	public function getArmorInventory() : ArmorInventory{

Backtrace:
#0 src/pocketmine/entity/Living(454): pocketmine\entity\Living->getHighestArmorEnchantmentLevel(integer 1)
#1 plugins/PiggyCustomEnchants-master/src/DaPigGuy/PiggyCustomEnchants/enchants/armor/MoltenEnchant(41): pocketmine\entity\Living->setOnFire(integer 9)
#2 src/pocketmine/scheduler/ClosureTask(57): DaPigGuy\PiggyCustomEnchants\enchants\armor\MoltenEnchant->DaPigGuy\PiggyCustomEnchants\enchants\armor\{closure}(integer 240327)
#3 src/pocketmine/scheduler/TaskHandler(159): pocketmine\scheduler\ClosureTask->onRun(integer 240327)
#4 src/pocketmine/scheduler/TaskScheduler(199): pocketmine\scheduler\TaskHandler->run(integer 240327)
#5 src/pocketmine/plugin/PluginManager(682): pocketmine\scheduler\TaskScheduler->mainThreadHeartbeat(integer 240327)
#6 src/pocketmine/Server(2570): pocketmine\plugin\PluginManager->tickSchedulers(integer 240327)
#7 src/pocketmine/Server(2346): pocketmine\Server->tick()
#8 src/pocketmine/Server(2203): pocketmine\Server->tickProcessor()
#9 src/pocketmine/Server(1785): pocketmine\Server->start()
#10 src/pocketmine/PocketMine(272): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[10] /root/PvP/, string[18] /root/PvP/plugins/)
#11 src/pocketmine/PocketMine(295): pocketmine\server()

PocketMine-MP version: 3.11.2 [Protocol 389]
Git commit: 4c744aacfa5513517af2bf4e0e9c46c77ceb307c-dirty
uname -a: Linux pe.templehq.eu 4.15.0 #1 SMP Thu Feb 21 17:35:43 MSK 2019 x86_64
PHP Version: 7.3.8
Zend version: 3.3.8
OS : Linux, linux
@Aericio Aericio changed the title Molten bug Molten: Call to a member function getContents() on null Jan 11, 2020
Aericio added a commit that referenced this issue Jan 18, 2020
Co-authored-by: Aericio <16523741+Aericio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants