TheAz928 / VanillaEnchantments

Ever wanted to have working Enchants on your PocketMine-MP server? Well now you can!
GNU General Public License v3.0
40 stars 33 forks source link

Undefined variable: dmg on VanillaEnchantments #19

Closed nasiridrishi closed 6 years ago

nasiridrishi commented 6 years ago

PocketMine-MP 1.7dev-473 「[REDACTED]」 implementing API version 3.0.0-ALPHA10 VanillaEnchantments v2.0.0-dev

[Server thread/CRITICAL]: Could not pass event 'pocketmine\event\entity\EntityDamageEvent' to 'VanillaEnchantments v2.0.0-dev': Undefined variable: dmg on VanillaEnchantments\handlers\FireProtection
[00:47:46] [Server thread/CRITICAL]: ErrorException: "Undefined variable: dmg" (EXCEPTION) in "VanillaEnchantments_v2.0.0-dev.phar/src/VanillaEnchantments/handlers/FireProtection" at line 30
[00:47:46] [Server thread/DEBUG]: #0 VanillaEnchantments_v2.0.0-dev.phar/src/VanillaEnchantments/handlers/FireProtection(30): pocketmine\error_handler(integer 8, string Undefined variable: dmg, string phar://C:/Users/Nasir Husain/Desktop/PluginTutorialServer/plugins/VanillaEnchantments_v2.0.0-dev.phar/src/VanillaEnchantments/handlers/FireProtection.php, integer 30, array Array())
[00:47:46] [Server thread/DEBUG]: #1 src/pocketmine/plugin/MethodEventExecutor(38): VanillaEnchantments\handlers\FireProtection->onDamage(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #2 src/pocketmine/plugin/RegisteredListener(98): pocketmine\plugin\MethodEventExecutor->execute(VanillaEnchantments\handlers\FireProtection object, pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(721): pocketmine\plugin\RegisteredListener->callEvent(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #4 src/pocketmine/entity/Entity(850): pocketmine\plugin\PluginManager->callEvent(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #5 src/pocketmine/entity/Living(377): pocketmine\entity\Entity->attack(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #6 src/pocketmine/Player(3614): pocketmine\entity\Living->attack(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #7 src/pocketmine/entity/Living(350): pocketmine\Player->attack(pocketmine\event\entity\EntityDamageEvent object)
[00:47:46] [Server thread/DEBUG]: #8 src/pocketmine/entity/Entity(1363): pocketmine\entity\Living->fall(double 13.2512)
[00:47:46] [Server thread/DEBUG]: #9 src/pocketmine/entity/Entity(1587): pocketmine\entity\Entity->updateFallState(double -1.7488, boolean 1)
[00:47:46] [Server thread/DEBUG]: #10 src/pocketmine/Player(1503): pocketmine\entity\Entity->move(double 0, double -1.7488, double 0)
[00:47:46] [Server thread/DEBUG]: #11 src/pocketmine/Player(1663): pocketmine\Player->processMovement(integer 1)
[00:47:46] [Server thread/DEBUG]: #12 src/pocketmine/level/Level(735): pocketmine\Player->onUpdate(integer 1899)
[00:47:46] [Server thread/DEBUG]: #13 src/pocketmine/Server(2375): pocketmine\level\Level->doTick(integer 1899)
[00:47:46] [Server thread/DEBUG]: #14 src/pocketmine/Server(2532): pocketmine\Server->checkTickUpdates(integer 1899, double 1512415066.3005)
[00:47:46] [Server thread/DEBUG]: #15 src/pocketmine/Server(2272): pocketmine\Server->tick()
[00:47:46] [Server thread/DEBUG]: #16 src/pocketmine/Server(2147): pocketmine\Server->tickProcessor()
[00:47:46] [Server thread/DEBUG]: #17 src/pocketmine/Server(1735): pocketmine\Server->start()
[00:47:46] [Server thread/DEBUG]: #18 src/pocketmine/PocketMine(552): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string phar://C:/Users/Nasir Husain/Desktop/PluginTutorialServer/PocketMine-MP.phar/, string C:\Users\Nasir Husain\Desktop\PluginTutorialServer\, string C:\Users\Nasir Husain\Desktop\PluginTutorialServer\plugins\)
[00:47:46] [Server thread/DEBUG]: #19 C:/Users/Nasir Husain/Desktop/PluginTutorialServer/PocketMine-MP.phar(1): require(string phar://C:/Users/Nasir Husain/Desktop/PluginTutorialServer/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
inxomnyaa commented 6 years ago

I can not see that variable anywhere in the latest code, please make sure you are up-to date

nasiridrishi commented 6 years ago

I am using latest commit!! And why it stops working I mean loads but don't register enchants when I install piggy custom enchants

inxomnyaa commented 6 years ago

Probably solved in https://github.com/TheAz928/VanillaEnchantments/pull/20

inxomnyaa commented 6 years ago

But your issue seems due to outdated source anyways.

Undefined variable: dmg" (EXCEPTION) in "VanillaEnchantments_v2.0.0-dev.phar/src/VanillaEnchantments/handlers/FireProtection" at line 30

https://github.com/TheAz928/VanillaEnchantments/blob/master/src/VanillaEnchantments/handlers/FireProtection.php#L30

nasiridrishi commented 6 years ago

Ty

nasiridrishi commented 6 years ago

@thebigsmileXD why its not working when i load piggycustom enchants?

inxomnyaa commented 6 years ago

Seems to be PCE's fault, the damage hander there tries stuff that is invalid.. might you message Piggy?

nasiridrishi commented 6 years ago

yea ok!

DaPigGuy commented 6 years ago

@optimusprime338 I've tested this plugin with the latest version of PiggyCE. Both plugins work as intended. Please try with the latest version. If this doesn't fix the issue, open an issue on PiggyCE's repo with specific details about what's wrong.