InventoryTransaction: Fixed indexes persisting from balance calculation in crafting input/outputs

fixes #4019
the order of the actual items may not be the same across runs, but index 0 will at least be sure to exist.
This commit is contained in:
Dylan K. Taylor 2021-02-02 00:13:58 +00:00
parent bef906b0f0
commit 1a24afc6d1
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -30,6 +30,7 @@ use pocketmine\inventory\transaction\action\SlotChangeAction;
use pocketmine\item\Item;
use pocketmine\Player;
use function array_keys;
use function array_values;
use function assert;
use function count;
use function get_class;
@ -168,6 +169,8 @@ class InventoryTransaction{
}
}
}
$needItems = array_values($needItems);
$haveItems = array_values($haveItems);
}
/**