{"id":16373954,"url":"https://github.com/minidigger/kinventories","last_synced_at":"2025-07-06T18:32:41.974Z","repository":{"id":152344218,"uuid":"93257099","full_name":"MiniDigger/KInventories","owner":"MiniDigger","description":"A simplified way to make GUIs in Spigot. Name subject to change, Kotlin only.","archived":false,"fork":false,"pushed_at":"2019-10-18T09:43:48.000Z","size":96,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-01T00:28:07.767Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiniDigger.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-03T15:32:47.000Z","updated_at":"2020-06-24T11:48:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6a61f58-8605-46d3-b653-15a0abe53660","html_url":"https://github.com/MiniDigger/KInventories","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiniDigger%2FKInventories","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiniDigger%2FKInventories/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiniDigger%2FKInventories/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiniDigger%2FKInventories/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiniDigger","download_url":"https://codeload.github.com/MiniDigger/KInventories/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239946261,"owners_count":19722914,"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":[],"created_at":"2024-10-11T03:15:42.988Z","updated_at":"2025-02-21T02:35:29.635Z","avatar_url":"https://github.com/MiniDigger.png","language":"Kotlin","readme":"[ ![Download](https://api.bintray.com/packages/redrield/maven/kinventories/images/download.svg) ](https://bintray.com/redrield/maven/kinventories/_latestVersion)\n\n# KInventories\n\n\n## Documentation\nThere aren't compiled javadocs as of yet, but the code does have comments to assist you.\n\n## Basic usage (Kotlin)\nKInventories works on a series of inline functions and extension functions. Declaring a basic unnamed inventory looks like this:\n```kotlin\ninventory(9) {\n    \n}\n```\nThis declares an inventory with size 9. Everything in the following block is applied to the inventory. This is how you would add items to the inventories.\n\n```kotlin\ninventory(9) {\n    itemStack(Material.ANVIL) {\n        \n    }\n}\n```\nThis declares an inventory with an anvil in the first slot. Beyond this, you can add properties to the item in its block. To access the meta of the item, you can use `itemMeta { }` \n\n```kotlin\ninventory(9) {\n    itemStack(Material.ANVIL) {\n        itemMeta {\n            displayName = \"Hello World!\"\n        }\n    }\n}\n```\nThis would create an inventory with an item named \"Hello World!\". The final thing that you'll need to know is how to register callbacks. KInventories provides you with 3 possible callbacks to register: Item click callbacks (`onClick { }`), inventory open callbacks (`onOpen { }`), and inventory close callbacks (`onClose { }`).\nAll available methods will be available and documented ASAP\n\n##Getting started (Java)\nThe Java portion of the API is significantly less graceful than the Kotlin portion, because of limitations in what I can do with the language. Declaring an inventory in Java looks like this\n```java\nInventoryBuilder.create(9).build();\n```\nThis creates an InventoryBuilder that contains an Inventory of size 9, then immediately builds it. The resulting inventory is of course empty. To add items to it, you would use `addItem()` before calling build\n```java\nInventoryBuilder.create(9)\n                .addItem(Material.ANVIL, 1, item -\u003e {\n                    \n                }).build();\n```\nThis adds 1 anvil to the first slot of the inventory. the Consumer that is provided can be used to add data to the item before adding it to the inventory, like so:\n\n```java\nInventoryBuilder.create(9)\n                .addItem(Material.ANVIL, 1, item -\u003e {\n                    item.withMeta(meta -\u003e {\n                        meta.setDisplayName(\"Hello World\");\n                    });\n                }).build();\n```\nLike I said, it's not graceful. This would add an item with the meta you add to it. Beyond that, you can add anything to the ItemStack by manipulating the `inner` field in ItemStackBuilder that is made available to you.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminidigger%2Fkinventories","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminidigger%2Fkinventories","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminidigger%2Fkinventories/lists"}