Fixed matchItems corrupting CraftingTransaction internal state on repeated validation

This bug became apparent while developing a more robust fix for 1.16 crafting.
This commit is contained in:
Dylan K. Taylor 2020-08-02 23:07:47 +01:00
parent df2c3136c9
commit 756840f11d

View File

@ -136,6 +136,8 @@ class InventoryTransaction{
* @throws TransactionValidationException
*/
protected function matchItems(array &$needItems, array &$haveItems) : void{
$needItems = [];
$haveItems = [];
foreach($this->actions as $key => $action){
if(!$action->getTargetItem()->isNull()){
$needItems[] = $action->getTargetItem();