mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-23 19:34:15 +00:00
Quick-fix for crafting with big crafting grid after cancelling PlayerInteractEvent on a crafting table
this is not an ideal solution, but it works. Crafting is messy and is going to need more refactoring. Fixes #1480
This commit is contained in:
parent
878f1bffb9
commit
78cf875080
@ -59,6 +59,10 @@ class CraftingTransaction extends InventoryTransaction{
|
|||||||
$y = (int) ($index / $this->gridSize);
|
$y = (int) ($index / $this->gridSize);
|
||||||
$x = $index % $this->gridSize;
|
$x = $index % $this->gridSize;
|
||||||
|
|
||||||
|
if(!isset($this->inputs[$y][$x])){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->inputs[$y][$x]->isNull()){
|
if($this->inputs[$y][$x]->isNull()){
|
||||||
$this->inputs[$y][$x] = clone $item;
|
$this->inputs[$y][$x] = clone $item;
|
||||||
}elseif(!$this->inputs[$y][$x]->equals($item)){
|
}elseif(!$this->inputs[$y][$x]->equals($item)){
|
||||||
@ -74,6 +78,10 @@ class CraftingTransaction extends InventoryTransaction{
|
|||||||
$y = (int) ($index / $this->gridSize);
|
$y = (int) ($index / $this->gridSize);
|
||||||
$x = $index % $this->gridSize;
|
$x = $index % $this->gridSize;
|
||||||
|
|
||||||
|
if(!isset($this->secondaryOutputs[$y][$x])){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($this->secondaryOutputs[$y][$x]->isNull()){
|
if($this->secondaryOutputs[$y][$x]->isNull()){
|
||||||
$this->secondaryOutputs[$y][$x] = clone $item;
|
$this->secondaryOutputs[$y][$x] = clone $item;
|
||||||
}elseif(!$this->secondaryOutputs[$y][$x]->equals($item)){
|
}elseif(!$this->secondaryOutputs[$y][$x]->equals($item)){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user