DaPigGuy / PiggyCustomEnchants

An open source custom enchantment plugin for PocketMine-MP
https://piggydocs.aericio.net/PiggyCustomEnchants.html
Apache License 2.0
103 stars 118 forks source link

Overload Enchant causes Internal Server Error #284

Closed notacoderr closed 4 years ago

notacoderr commented 4 years ago

Please make sure your issue complies with these guidelines:

Issue Description

Steps to Reproduce the Issue

  1. Enchant any armor with overload
  2. Take some damage (to update your health) or rejoin the server

OS and Versions

[19:18:31] [Server thread/CRITICAL]: InvalidArgumentException: "Maximum -4 is less than the minimum 0" (EXCEPTION) in "src/pocketmine/entity/Attribute" at line 153 [19:18:31] [Server thread/DEBUG]: #0 src/pocketmine/entity/Living(158): pocketmine\entity\Attribute->setMaxValue(double -4) [19:18:31] [Server thread/DEBUG]: #1 plugins/PiggyCustomEnchants_dev-437.phar/src/DaPigGuy/PiggyCustomEnchants/enchants/armor/OverloadEnchant(34): pocketmine\entity\Living->setMaxHealth(integer -4) [19:18:31] [Server thread/DEBUG]: #2 plugins/PiggyCustomEnchants_dev-437.phar/src/DaPigGuy/PiggyCustomEnchants/enchants/traits/ToggleTrait(43): DaPigGuy\PiggyCustomEnchants\enchants\armor\OverloadEnchant->toggle(object pocketmine\Player, object pocketmine\item\DiamondBoots, object pocketmine\inventory\ArmorInventory, integer 3, integer 3, boolean ) [19:18:31] [Server thread/DEBUG]: #3 plugins/PiggyCustomEnchants_dev-437.phar/src/DaPigGuy/PiggyCustomEnchants/enchants/traits/ToggleTrait(83): DaPigGuy\PiggyCustomEnchants\enchants\ToggleableEnchantment->onToggle(object pocketmine\Player, object pocketmine\item\DiamondBoots, object pocketmine\inventory\ArmorInventory, integer 3, integer 3, boolean ) [19:18:31] [Server thread/DEBUG]: #4 plugins/PiggyCustomEnchants_dev-437.phar/src/DaPigGuy/PiggyCustomEnchants/EventListener(119): DaPigGuy\PiggyCustomEnchants\enchants\ToggleableEnchantment::attemptToggle(object pocketmine\Player, object pocketmine\item\DiamondBoots, object pocketmine\item\enchantment\EnchantmentInstance, object pocketmine\inventory\ArmorInventory, integer 3, boolean )

DaPigGuy commented 4 years ago

Duplicate of #283

DaPigGuy commented 4 years ago

Do you have any idea on how to reproduce the issue?

ZaXtha commented 4 years ago

Same problem

Aericio commented 4 years ago

Further conversation in #283 instead