PocketMine-MP
5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
CraftItemEvent.php
1
<?php
2
3
/*
4
*
5
* ____ _ _ __ __ _ __ __ ____
6
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10
*
11
* This program is free software: you can redistribute it and/or modify
12
* it under the terms of the GNU Lesser General Public License as published by
13
* the Free Software Foundation, either version 3 of the License, or
14
* (at your option) any later version.
15
*
16
* @author PocketMine Team
17
* @link http://www.pocketmine.net/
18
*
19
*
20
*/
21
22
declare(strict_types=1);
23
24
namespace
pocketmine\event\inventory
;
25
26
use
pocketmine\crafting\CraftingRecipe
;
27
use
pocketmine\event\Cancellable
;
28
use pocketmine\event\CancellableTrait;
29
use
pocketmine\event\Event
;
30
use
pocketmine\inventory\transaction\CraftingTransaction
;
31
use
pocketmine\item\Item
;
32
use
pocketmine\player\Player
;
33
use
pocketmine\utils\Utils
;
34
35
class
CraftItemEvent
extends
Event
implements
Cancellable
{
36
use
CancellableTrait
;
37
42
public
function
__construct
(
43
private
CraftingTransaction
$transaction,
44
private
CraftingRecipe
$recipe,
45
private
int
$repetitions,
46
private
array $inputs,
47
private
array $outputs
48
){}
49
53
public
function
getTransaction
() :
CraftingTransaction
{
54
return $this->transaction;
55
}
56
60
public
function
getRecipe
() :
CraftingRecipe
{
61
return $this->recipe;
62
}
63
68
public
function
getRepetitions
() : int{
69
return $this->repetitions;
70
}
71
77
public
function
getInputs
() : array{
78
return
Utils
::cloneObjectArray($this->inputs);
79
}
80
86
public
function
getOutputs
() : array{
87
return
Utils
::cloneObjectArray($this->outputs);
88
}
89
90
public
function
getPlayer() :
Player
{
91
return $this->transaction->getSource();
92
}
93
}
pocketmine\event\Event
Definition
Event.php:33
pocketmine\event\inventory\CraftItemEvent
Definition
CraftItemEvent.php:35
pocketmine\event\inventory\CraftItemEvent\getTransaction
getTransaction()
Definition
CraftItemEvent.php:53
pocketmine\event\inventory\CraftItemEvent\__construct
__construct(private CraftingTransaction $transaction, private CraftingRecipe $recipe, private int $repetitions, private array $inputs, private array $outputs)
Definition
CraftItemEvent.php:42
pocketmine\event\inventory\CraftItemEvent\getRepetitions
getRepetitions()
Definition
CraftItemEvent.php:68
pocketmine\event\inventory\CraftItemEvent\getInputs
getInputs()
Definition
CraftItemEvent.php:77
pocketmine\event\inventory\CraftItemEvent\getRecipe
getRecipe()
Definition
CraftItemEvent.php:60
pocketmine\event\inventory\CraftItemEvent\getOutputs
getOutputs()
Definition
CraftItemEvent.php:86
pocketmine\inventory\transaction\CraftingTransaction
Definition
CraftingTransaction.php:56
pocketmine\item\Item
Definition
Item.php:60
pocketmine\player\Player
Definition
Player.php:168
pocketmine\utils\Utils
Definition
Utils.php:103
pocketmine\crafting\CraftingRecipe
Definition
CraftingRecipe.php:28
pocketmine\event\Cancellable
Definition
Cancellable.php:34
pocketmine\event\inventory
Definition
CraftItemEvent.php:24
pocketmine\event\CancellableTrait
trait CancellableTrait
Definition
CancellableTrait.php:34
src
event
inventory
CraftItemEvent.php
Generated by
1.12.0