RevivalPMMP / PureEntitiesX

A Revival of the original PureEntities, a plugin which provides MobAI for PMMP - Coming back soon
GNU General Public License v3.0
166 stars 76 forks source link

Crash #362

Closed GoodLucky777 closed 4 years ago

GoodLucky777 commented 5 years ago

Required Information

PocketMine-MP Version:3.9.5 Plugin Version:0.6.3 Where you got the plugin:Poggit

Optional Information

PHP version:7.3 Other Installed Plugins:EconomyApi OS Version:Linux

Steps to reproduce the issue.

Description

Sometime, I crash my server because of this plugin.


PocketMine-MP Crash Dump Sat Oct 12 05:53:40 CEST 2019

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

A PLUGIN WAS INVOLVED IN THIS CRASH
BAD PLUGIN: PureEntitiesX v0.6.3

Code:
[414]   /**
[415]    * Returns how many armour points this mob has. Armour points provide a percentage reduction to damage.
[416]    * For mobs which can wear armour, this should return the sum total of the armour points provided by their
[417]    * equipment.
[418]    *
[419]    * @return int
[420]    */
[421]   public function getArmorPoints() : int{
[422]       $total = 0;
[423]       foreach($this->armorInventory->getContents() as $item){
[424]           $total += $item->getDefensePoints();
[425]       }
[426] 
[427]       return $total;
[428]   }
[429] 
[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

Backtrace:
#0 src/pocketmine/entity/Living(466): pocketmine\entity\Living->getArmorPoints()
#1 src/pocketmine/entity/Living(562): pocketmine\entity\Living->applyDamageModifiers(object pocketmine\event\entity\EntityDamageByEntityEvent)
#2 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/walking/Spider(57): pocketmine\entity\Living->attack(object pocketmine\event\entity\EntityDamageByEntityEvent)
#3 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/WalkingMonster(72): revivalpmmp\pureentities\entity\monster\walking\Spider->attackEntity(object CortexPE\entity\object\Lightning)
#4 plugins/PureEntitiesX.phar/src/revivalpmmp/pureentities/entity/monster/WalkingMonster(198): revivalpmmp\pureentities\entity\monster\WalkingMonster->checkAndAttackEntity(object CortexPE\entity\object\Lightning)
#5 src/pocketmine/level/Level(853): revivalpmmp\pureentities\entity\monster\WalkingMonster->onUpdate(integer 128927)
#6 src/pocketmine/level/Level(786): pocketmine\level\Level->actuallyDoTick(integer 128927)
#7 src/pocketmine/Server(2446): pocketmine\level\Level->doTick(integer 128927)
#8 src/pocketmine/Server(2577): pocketmine\Server->checkTickUpdates(integer 128927, double 1570852420.1242)
#9 src/pocketmine/Server(2346): pocketmine\Server->tick()
#10 src/pocketmine/Server(2206): pocketmine\Server->tickProcessor()
#11 src/pocketmine/Server(1784): pocketmine\Server->start()
#12 src/pocketmine/PocketMine(275): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/minecraft/, string[24] /home/minecraft/plugins/)
#13 src/pocketmine/PocketMine(299): pocketmine\server()
#14 (1): require(string[68] phar:///home/minecraft/pocketmine.phar/src/pocketmine/PocketMine.php)

PocketMine-MP version: 3.9.5 [Protocol 361]
Git commit: f0539f48983a3961290f2a4b9828586cc11b0008
uname -a: Linux ab6331368095 4.19.0-0.bpo.2-amd64 #1 SMP Debian 4.19.16-1~bpo9+1 (2019-02-07) x86_64
PHP Version: 7.3.6
Zend version: 3.3.6
OS : Linux, linux
GoodLucky777 commented 5 years ago

How to fix that?

95CivicSi commented 4 years ago

This should be fixed as of https://github.com/RevivalPMMP/PureEntitiesX/commit/0b14a9ecc55f9a4516a43b07cc51290c2052013a

Please update to the newest version and report any further problems in a new issue.