PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
FurnaceInventory.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 namespace pocketmine\inventory;
23 
24 
27 
29  public function __construct(Furnace $tile){
30  parent::__construct($tile, InventoryType::get(InventoryType::FURNACE));
31  }
32 
36  public function getHolder(){
37  return $this->holder;
38  }
39 
43  public function getResult(){
44  return $this->getItem(2);
45  }
46 
50  public function getFuel(){
51  return $this->getItem(1);
52  }
53 
57  public function getSmelting(){
58  return $this->getItem(0);
59  }
60 
66  public function setResult(Item $item){
67  return $this->setItem(2, $item);
68  }
69 
75  public function setFuel(Item $item){
76  return $this->setItem(1, $item);
77  }
78 
84  public function setSmelting(Item $item){
85  return $this->setItem(0, $item);
86  }
87 
88  public function onSlotChange($index, $before, $source = null){
89  parent::onSlotChange($index, $before, $source);
90 
91  $this->getHolder()->scheduleUpdate();
92  }
93 }
onSlotChange($index, $before, $source=null)
setItem($index, Item $item, $source=null)