Muqsit / InvMenu

A PocketMine-MP virion to create and manage virtual inventories!
https://poggit.pmmp.io/ci/Muqsit/InvMenu/~
GNU General Public License v3.0
203 stars 76 forks source link

Register custom menu PM5 #239

Open EmporiumPvP opened 1 year ago

EmporiumPvP commented 1 year ago

I was wondering how we would be able to register custom menus now since they removed BlockFactory and BlockLegacyIds

it still has the old way on the wiki.

public const TYPE_DISPENSER = "myplugin:dispenser";

protected function onEnable() : void{ InvMenuHandler::getTypeRegistry()->register(self::TYPE_DISPENSER, InvMenuTypeBuilders::BLOCK_ACTOR_FIXED() ->setBlock(BlockFactory::getInstance()->get(BlockLegacyIds::DISPENSER, 0)) ->setBlockActorId("Dispenser") ->setSize(9) ->setNetworkWindowType(WindowTypes::DISPENSER) ->build()); }

SwiftyMCPE commented 1 year ago

@Muqsit pls update the wiki