mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
"Fixed" shift-clicking recipe book, close #1401
this is not an optimal solution because you'll still only get 1 crafting event when the user actually crafted a lot of items, so this isn't very nice for plugins to work with. However, for gameplay purposes it works, so it'll do for now.
This commit is contained in:
parent
a547e2cca8
commit
97e2d64592
@ -61,8 +61,8 @@ class CraftingTransaction extends InventoryTransaction{
|
||||
|
||||
if($this->inputs[$y][$x]->isNull()){
|
||||
$this->inputs[$y][$x] = clone $item;
|
||||
}else{
|
||||
throw new \RuntimeException("Input $index has already been set");
|
||||
}elseif(!$this->inputs[$y][$x]->equals($item)){
|
||||
throw new \RuntimeException("Input $index has already been set and does not match the current item (expected " . $this->inputs[$y][$x] . ", got " . $item . ")");
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,8 +76,8 @@ class CraftingTransaction extends InventoryTransaction{
|
||||
|
||||
if($this->secondaryOutputs[$y][$x]->isNull()){
|
||||
$this->secondaryOutputs[$y][$x] = clone $item;
|
||||
}else{
|
||||
throw new \RuntimeException("Output $index has already been set");
|
||||
}elseif(!$this->secondaryOutputs[$y][$x]->equals($item)){
|
||||
throw new \RuntimeException("Output $index has already been set and does not match the current item (expected " . $this->secondaryOutputs[$y][$x] . ", got " . $item . ")");
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,8 +88,8 @@ class CraftingTransaction extends InventoryTransaction{
|
||||
public function setPrimaryOutput(Item $item) : void{
|
||||
if($this->primaryOutput === null){
|
||||
$this->primaryOutput = clone $item;
|
||||
}else{
|
||||
throw new \RuntimeException("Primary result item has already been set");
|
||||
}elseif(!$this->primaryOutput->equals($item)){
|
||||
throw new \RuntimeException("Primary result item has already been set and does not match the current item (expected " . $this->primaryOutput . ", got " . $item . ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user