mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
CraftItemEvent: fixed inputs and outputs not being cloned
This commit is contained in:
parent
b45b4b5edf
commit
ebcd6a0bb2
@ -30,6 +30,7 @@ use pocketmine\event\Event;
|
|||||||
use pocketmine\inventory\transaction\CraftingTransaction;
|
use pocketmine\inventory\transaction\CraftingTransaction;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
use pocketmine\utils\Utils;
|
||||||
|
|
||||||
class CraftItemEvent extends Event implements Cancellable{
|
class CraftItemEvent extends Event implements Cancellable{
|
||||||
use CancellableTrait;
|
use CancellableTrait;
|
||||||
@ -74,7 +75,7 @@ class CraftItemEvent extends Event implements Cancellable{
|
|||||||
* @return Item[]
|
* @return Item[]
|
||||||
*/
|
*/
|
||||||
public function getInputs() : array{
|
public function getInputs() : array{
|
||||||
return $this->inputs;
|
return Utils::cloneObjectArray($this->inputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +84,7 @@ class CraftItemEvent extends Event implements Cancellable{
|
|||||||
* @return Item[]
|
* @return Item[]
|
||||||
*/
|
*/
|
||||||
public function getOutputs() : array{
|
public function getOutputs() : array{
|
||||||
return $this->outputs;
|
return Utils::cloneObjectArray($this->outputs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPlayer() : Player{
|
public function getPlayer() : Player{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user