GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
BrewingRecipe Class Reference

Public Member Functions

 __construct (Item $result, Item $ingredient, Item $potion)
 
 getPotion ()
 
 getId ()
 
 setId (UUID $id)
 
 setInput (Item $item)
 
 getInput ()
 
 getResult ()
 
 registerToCraftingManager ()
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( Item  $result,
Item  $ingredient,
Item  $potion 
)

BrewingRecipe constructor.

Parameters
Item$result
Item$ingredient
Item$potion
48  {
49  $this->output = clone $result;
50  $this->ingredient = clone $ingredient;
51  $this->potion = clone $potion;
52  }

Member Function Documentation

◆ getId()

getId ( )
Returns
null

Implements Recipe.

64  {
65  return $this->id;
66  }

◆ getInput()

getInput ( )
Returns
Item
89  {
90  return clone $this->ingredient;
91  }

◆ getPotion()

getPotion ( )
Returns
Item
57  {
58  return clone $this->potion;
59  }

◆ getResult()

getResult ( )
Returns
Item

Implements Recipe.

96  {
97  return clone $this->output;
98  }

◆ registerToCraftingManager()

registerToCraftingManager ( )

Implements Recipe.

100  {
101  Server::getInstance()->getCraftingManager()->registerBrewingRecipe($this);
102  }

◆ setId()

setId ( UUID  $id)
Parameters
UUID$id
71  {
72  if($this->id !== null){
73  throw new \InvalidStateException("Id is already set");
74  }
75 
76  $this->id = $id;
77  }

◆ setInput()

setInput ( Item  $item)
Parameters
Item$item
82  {
83  $this->ingredient = clone $item;
84  }

The documentation for this class was generated from the following file: