CortexPE / TeaSpoon

☕ A PLUGIN to Extend PMMP's Functionality without completely changing it.
GNU Affero General Public License v3.0
144 stars 100 forks source link

Fire bug #380

Closed janleigh closed 5 years ago

janleigh commented 5 years ago

Error

[12:57:11] [Server thread/CRITICAL]: ErrorException: "Undefined offset: 9" (EXCEPTION) in "plugins/TeaSpoon_dev-267.phar/src/CortexPE/block/Fire" at line 58

[12:57:11] [Server thread/DEBUG]: #0 plugins/TeaSpoon_dev-267.phar/src/CortexPE/block/Fire(58): pocketmine\utils\Utils::errorExceptionHandler(integer 8, string Undefined offset: 9, string phar:///home/minecraft/plugins/TeaSpoon_dev-267.phar/src/CortexPE/block/Fire.php, integer 58, array Array())

[12:57:11] [Server thread/DEBUG]: #1 src/pocketmine/level/Level(1119): CortexPE\block\Fire->onRandomTick()

[12:57:11] [Server thread/DEBUG]: #2 src/pocketmine/level/Level(871): pocketmine\level\Level->tickChunks()

[12:57:11] [Server thread/DEBUG]: #3 src/pocketmine/level/Level(794): pocketmine\level\Level->actuallyDoTick(integer 37279)

[12:57:11] [Server thread/DEBUG]: #4 src/pocketmine/Server(2425): pocketmine\level\Level->doTick(integer 37279)

[12:57:11] [Server thread/DEBUG]: #5 src/pocketmine/Server(2556): pocketmine\Server->checkTickUpdates(integer 37279, double 1555153031.9754)

[12:57:11] [Server thread/DEBUG]: #6 src/pocketmine/Server(2325): pocketmine\Server->tick()

[12:57:11] [Server thread/DEBUG]: #7 src/pocketmine/Server(2186): pocketmine\Server->tickProcessor()

[12:57:11] [Server thread/DEBUG]: #8 src/pocketmine/Server(1765): pocketmine\Server->start()

[12:57:11] [Server thread/DEBUG]: #9 src/pocketmine/PocketMine(250): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/minecraft/, string /home/minecraft/plugins/)

[12:57:11] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump

[12:57:11] [Server thread/EMERGENCY]: Please upload the "/home/minecraft/crashdumps/Sat_Apr_13-12.57.11-CEST_2019.log" file to the Crash Archive and submit the link to the Bug Reporting page. Give as much info as you can.

AlLiberali commented 5 years ago

Quick repair (not standard one): Replace CortexPE\block\Fire $weather variable at onRandomTick() with this (You should use CortexPE\level\weather\Weather before that)

$weather = isset(Main::$weatherData[$this->getLevel()->getId()]) ? Main::$weatherData[$this->getLevel()->getId()] : Main::$weatherData[$this->getLevel()->getId()] = new Weather($this->getLevel(), 0);