PocketMine-MP
5.25.3 git-afc4a3c7f18d42b41cbfde84ab6a2e4dd7c03045
Loading...
Searching...
No Matches
src/crafting/PotionTypeRecipe.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\crafting;
25
26
use
pocketmine\item\Item
;
27
28
class
PotionTypeRecipe
implements
BrewingRecipe
{
29
30
public
function
__construct(
31
private
RecipeIngredient
$input,
32
private
RecipeIngredient
$ingredient,
33
private
Item
$output
34
){
35
$this->output = clone $output;
36
}
37
38
public
function
getInput() :
RecipeIngredient
{
39
return
$this->input;
40
}
41
42
public
function
getIngredient() :
RecipeIngredient
{
43
return
$this->ingredient;
44
}
45
46
public
function
getOutput() :
Item
{
47
return
clone $this->output;
48
}
49
50
public
function
getResultFor(
Item
$input) : ?
Item
{
51
return
$this->input->accepts($input) ? $this->getOutput() :
null
;
52
}
53
}
pocketmine\crafting\PotionTypeRecipe
Definition
src/crafting/PotionTypeRecipe.php:28
pocketmine\item\Item
Definition
Item.php:60
pocketmine\crafting\BrewingRecipe
Definition
BrewingRecipe.php:28
pocketmine\crafting\RecipeIngredient
Definition
src/crafting/RecipeIngredient.php:28
src
crafting
PotionTypeRecipe.php
Generated by
1.12.0