CraftItemEvent: fixed inputs and outputs not being cloned

This commit is contained in:
Dylan K. Taylor 2023-08-08 18:29:49 +01:00
parent b45b4b5edf
commit ebcd6a0bb2
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -30,6 +30,7 @@ use pocketmine\event\Event;
use pocketmine\inventory\transaction\CraftingTransaction;
use pocketmine\item\Item;
use pocketmine\player\Player;
use pocketmine\utils\Utils;
class CraftItemEvent extends Event implements Cancellable{
use CancellableTrait;
@ -74,7 +75,7 @@ class CraftItemEvent extends Event implements Cancellable{
* @return Item[]
*/
public function getInputs() : array{
return $this->inputs;
return Utils::cloneObjectArray($this->inputs);
}
/**
@ -83,7 +84,7 @@ class CraftItemEvent extends Event implements Cancellable{
* @return Item[]
*/
public function getOutputs() : array{
return $this->outputs;
return Utils::cloneObjectArray($this->outputs);
}
public function getPlayer() : Player{