mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added constant slot IDs for Furnace, Enchanting, Anvil and Brewing Stand inventories
This commit is contained in:
parent
2fe03757d5
commit
963f4a9cf3
@ -29,6 +29,12 @@ use pocketmine\world\Position;
|
||||
class BrewingStandInventory extends SimpleInventory implements BlockInventory{
|
||||
use BlockInventoryTrait;
|
||||
|
||||
public const SLOT_INGREDIENT = 0;
|
||||
public const SLOT_BOTTLE_LEFT = 1;
|
||||
public const SLOT_BOTTLE_MIDDLE = 2;
|
||||
public const SLOT_BOTTLE_RIGHT = 3;
|
||||
public const SLOT_FUEL = 4;
|
||||
|
||||
public function __construct(Position $holder, int $size = 5){
|
||||
$this->holder = $holder;
|
||||
parent::__construct($size);
|
||||
|
@ -30,6 +30,9 @@ use pocketmine\world\Position;
|
||||
class EnchantInventory extends SimpleInventory implements BlockInventory{
|
||||
use BlockInventoryTrait;
|
||||
|
||||
public const SLOT_INPUT = 0;
|
||||
public const SLOT_LAPIS = 1;
|
||||
|
||||
public function __construct(Position $holder){
|
||||
$this->holder = $holder;
|
||||
parent::__construct(2);
|
||||
|
@ -31,6 +31,10 @@ use pocketmine\world\Position;
|
||||
class FurnaceInventory extends SimpleInventory implements BlockInventory{
|
||||
use BlockInventoryTrait;
|
||||
|
||||
public const SLOT_INPUT = 0;
|
||||
public const SLOT_FUEL = 1;
|
||||
public const SLOT_RESULT = 2;
|
||||
|
||||
private FurnaceType $furnaceType;
|
||||
|
||||
public function __construct(Position $holder, FurnaceType $furnaceType){
|
||||
@ -42,26 +46,26 @@ class FurnaceInventory extends SimpleInventory implements BlockInventory{
|
||||
public function getFurnaceType() : FurnaceType{ return $this->furnaceType; }
|
||||
|
||||
public function getResult() : Item{
|
||||
return $this->getItem(2);
|
||||
return $this->getItem(self::SLOT_RESULT);
|
||||
}
|
||||
|
||||
public function getFuel() : Item{
|
||||
return $this->getItem(1);
|
||||
return $this->getItem(self::SLOT_FUEL);
|
||||
}
|
||||
|
||||
public function getSmelting() : Item{
|
||||
return $this->getItem(0);
|
||||
return $this->getItem(self::SLOT_INPUT);
|
||||
}
|
||||
|
||||
public function setResult(Item $item) : void{
|
||||
$this->setItem(2, $item);
|
||||
$this->setItem(self::SLOT_RESULT, $item);
|
||||
}
|
||||
|
||||
public function setFuel(Item $item) : void{
|
||||
$this->setItem(1, $item);
|
||||
$this->setItem(self::SLOT_FUEL, $item);
|
||||
}
|
||||
|
||||
public function setSmelting(Item $item) : void{
|
||||
$this->setItem(0, $item);
|
||||
$this->setItem(self::SLOT_INPUT, $item);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user