{"id":15144010,"url":"https://github.com/daykoala/windowy","last_synced_at":"2025-06-15T11:06:06.031Z","repository":{"id":43682985,"uuid":"450565401","full_name":"DayKoala/Windowy","owner":"DayKoala","description":"A Fake Inventory Generator For PocketMine-MP (PMMP)","archived":false,"fork":false,"pushed_at":"2022-07-11T01:02:56.000Z","size":297,"stargazers_count":19,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T19:52:05.388Z","etag":null,"topics":["php","pmmp","pmmp-plugin","pocketmine","pocketmine-plugins"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DayKoala.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-21T16:38:15.000Z","updated_at":"2025-02-22T21:03:56.000Z","dependencies_parsed_at":"2022-08-29T14:11:20.479Z","dependency_job_id":null,"html_url":"https://github.com/DayKoala/Windowy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DayKoala/Windowy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DayKoala%2FWindowy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DayKoala%2FWindowy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DayKoala%2FWindowy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DayKoala%2FWindowy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DayKoala","download_url":"https://codeload.github.com/DayKoala/Windowy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DayKoala%2FWindowy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259964327,"owners_count":22938724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","pmmp","pmmp-plugin","pocketmine","pocketmine-plugins"],"created_at":"2024-09-26T10:21:07.086Z","updated_at":"2025-06-15T11:06:06.007Z","avatar_url":"https://github.com/DayKoala.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/DayKoala/Windowy/stargazers\"\u003e\u003cimg src=\"https://i.ibb.co/pzyGrWx/Windowy-Gif.gif\"\u003e\u003c/img\u003e\u003c/a\u003e\u003cbr\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg alt= \"Last Commit\" src= \"https://img.shields.io/github/last-commit/DayKoala/Windowy?color=green\"\u003e\n\u003c/p\u003e\n\n# About\n\n- **[Windowy](https://github.com/DayKoala/Windowy)** is a temporary inventory generator and manager, focused on item transactions, for\n**[PocketMine-MP](https://github.com/pmmp/PocketMine-MP)**.\n\n- Functional as a Plugin and Library, for multiple different tasks.\n\n# WindowyLibrary\n\n- WindowyLibrary was created for direct tasks in plugins, follow the example of how to use below:\n\n```php\n\n# Do the following function in your PluginBase to activate it (WindowyLibrary).\n\nif(Windowy::hasHolder() === false){\n   Windowy::setHolder($this);\n}\n\n\n```\n\n# Getting a Window\n\n- Windowy comes with 4 registered inventories\n\n```php\n\nuse DayKoala\\inventory\\WindowIds;\n\n$id = WindowIds::CHEST;\n$id = WindowIds::DOUBLE_CHEST;\n$id = WindowIds::FURNACE;\n$id = WindowIds::HOPPER;\n\n```\n\n- You can get the desired inventory using:\n\n```php\n\nuse DayKoala\\inventory\\WindowFactory;\n\n/**\n *\n * @param String $id\n * @param String|null $name\n * @return SimpleWindow|null\n * \n */\n\n$window = WindowFactory::getInstance()-\u003eget($id, $name);\n\n```\n\n- If you want to simplify:\n\n```php\n\nuse DayKoala\\Windowy;\n\n$window = Windowy::getWindow($id, $name);\n\n```\n\n- It is ``not mandatory`` for you to fill in the ``name`` of the inventory, if you do not fill it or leave it in ``null``, the result will be the name of the inventory selected by the ``id``.\n\n# Registering your Window\n\n- You need the inventory you are going to register to be a ``SimpleWindow extension``, otherwise it won't work. Register ``your inventory`` like this:\n \n```php\n\nuse DayKoala\\block\\BlockEntityMetadata;\n\nuse pocketmine\\network\\mcpe\\protocol\\types\\inventory\\WindowTypes;\n\nuse pocketmine\\block\\tile\\Tile;\nuse pocketmine\\block\\BlockLegacyIds;\n\n/**\n *\n * @param Int $network\n * @param Int $size\n * @param BlockEntityMetadata $metadata\n * \n */\n\n$window = new MyWindow(WindowTypes::CONTAINER, 27, new BlockEntityMetadata(Tile::class, BlockLegacyIds::Block));\n\n```\n\n```php\n\n/**\n *\n * @param String $id\n * @param SimpleWindow $inventory\n * @param boolean $override\n * \n */\n\nWindowFactory::register('MyWindow', $window, $override);\n\n```\n\n# Adding Actions to Your Window\n\n- Actions can be ``added before or after`` registration, as well as items and derivatives. You can add ``a specific action`` to your inventory using:\n\n```php\n\nuse DayKoala\\inventory\\action\\WindowTransaction;\n\n$callback = function(WindowTransaction $action){\n   $player = $action-\u003egetPlayer();\n   $player-\u003esendMessage(\"I won't let you take this item haha!\");\n   $action-\u003ecancel();\n};\n\n/**\n *\n * @param Closure $callback\n * @return self\n * \n */\n\n$window-\u003esetTransaction($callback);\n\n```\n\n- If you want ``a certain item`` to have some ``action`` in the inventory, you can use:\n\n```php\n\n$window-\u003esetItem($slot, $item, $callback);\n\n```\n\nor\n\n```php\n\n/**\n *\n * @param Item $item\n * @param Closure $callback\n * @return self\n * \n */\n\n$window-\u003esetItemCallback($item, $callback);\n\n```\n\n- If the ``transaction is not canceled`` and the item moved from its defined slot, the ``item's action will be removed``.\n\n# Closing your Window Differently\n\n- Usually we need to do things in a different way and ``closing a window`` with a different action can help you, so you can ``add an action`` when closing it using:\n\n```php\n\nuse DayKoala\\inventory\\action\\WindowAction;\n\n$callback = function(WindowAction $action){\n   $player = $action-\u003egetPlayer();\n   $player-\u003esendMessage(\"Closing...\");\n};\n\n/**\n *\n * @param Closure $callback\n * @return self\n * \n */\n\n$window-\u003esetCloseCallback($callback);\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaykoala%2Fwindowy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaykoala%2Fwindowy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaykoala%2Fwindowy/lists"}