mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
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:
parent
df2c3136c9
commit
756840f11d
@ -136,6 +136,8 @@ class InventoryTransaction{
|
|||||||
* @throws TransactionValidationException
|
* @throws TransactionValidationException
|
||||||
*/
|
*/
|
||||||
protected function matchItems(array &$needItems, array &$haveItems) : void{
|
protected function matchItems(array &$needItems, array &$haveItems) : void{
|
||||||
|
$needItems = [];
|
||||||
|
$haveItems = [];
|
||||||
foreach($this->actions as $key => $action){
|
foreach($this->actions as $key => $action){
|
||||||
if(!$action->getTargetItem()->isNull()){
|
if(!$action->getTargetItem()->isNull()){
|
||||||
$needItems[] = $action->getTargetItem();
|
$needItems[] = $action->getTargetItem();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user