Files
PocketMine-MP/src/block/SmithingTable.php
Dylan K. Taylor 3c6b0993cc Finally deal with APIs on container and menu blocks
Two main interfaces are introduced:
- Container (chest, furnace, etc)
- MenuAccessor (includes Containers but also anvils, crafting tables etc. which are not containers)

Containers have inventories, locks, and everything from MenuAccessor
MenuAccessors have obstruction checks, and openToUnchecked() for plugins to use

I opted not to include precondition checks in openTo() because it's possible
to replicate those using the provided APIs if desired.
2025-08-30 23:38:07 +01:00

44 lines
1.3 KiB
PHP

<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\inventory\window\SmithingTableInventoryWindow;
use pocketmine\block\utils\MenuAccessor;
use pocketmine\block\utils\MenuAccessorTrait;
use pocketmine\player\InventoryWindow;
use pocketmine\player\Player;
use pocketmine\world\Position;
final class SmithingTable extends Opaque implements MenuAccessor{
use MenuAccessorTrait;
protected function newMenu(Player $player, Position $position) : InventoryWindow{
return new SmithingTableInventoryWindow($player, $position);
}
public function getFuelTime() : int{
return 300;
}
}