{"id":17800789,"url":"https://github.com/kiwiyou/consoled","last_synced_at":"2025-04-02T04:13:56.147Z","repository":{"id":113893296,"uuid":"221476678","full_name":"kiwiyou/Consoled","owner":"kiwiyou","description":"Bukkit commands made easy","archived":false,"fork":false,"pushed_at":"2019-11-13T14:25:41.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-07T18:53:38.731Z","etag":null,"topics":["craftbukkit-plugin","minecraft"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwiyou.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":"2019-11-13T14:21:54.000Z","updated_at":"2019-11-13T14:28:47.000Z","dependencies_parsed_at":"2023-11-29T01:15:11.488Z","dependency_job_id":null,"html_url":"https://github.com/kiwiyou/Consoled","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/kiwiyou%2FConsoled","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2FConsoled/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2FConsoled/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwiyou%2FConsoled/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwiyou","download_url":"https://codeload.github.com/kiwiyou/Consoled/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246752650,"owners_count":20827987,"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":["craftbukkit-plugin","minecraft"],"created_at":"2024-10-27T12:28:34.102Z","updated_at":"2025-04-02T04:13:56.122Z","avatar_url":"https://github.com/kiwiyou.png","language":"Java","readme":"Consoled is a CraftBukkit plugin which makes adding commands easy.\n\nTable of Contents\n------\n1. [Usage](#usage)\n    - [writing `commands.yml`](#writing-commandsyml)\n    - [writing executors](#writing-command-executors)\n    - [registering](#registering)\n2. [Compiling](#compiling)\n3. [Contributions](#contributions)\n\nUsage\n------\n1. Import the jar archive.\n2. Write [`commands.yml`] and embed it.\n3. Write your own command executors.\n4. Register your command executors.\n\n### Writing commands.yml\nYou can specify usages, permissions for commands.\u003cbr\u003e\n_All properties are optional._\n\n| Property | Description |\n| :---: | --- |\n| `_usage` | Displayed when the command fails. (executor returns false)\u003cbr\u003eCan inherit from the parent. |\n| `_perm` | Represents the permission required to execute the command. |\n| `_permMessage` | Displayed when the command fails due to the lack of permission.\u003cbr\u003eCan inherit from the parent. |\n| Others | Other properties are regarded as subcommands. |\n\n#### Example\n```yaml\nfoo:\n  _usage: /foo [bar/baz]\n  _permMessage: \"\u0026cYou don't have enough permission.\"\n  bar:\n    _usage: /foo bar [number]\n    _perm: foo.bar\n  baz:\n    _usage: /foo baz \u003cname\u003e\n    _perm: foo.baz\n```\n\n### Writing command executors\nAnnotation `@CommandFor(command)` can be used to delegate execution of the command to the method. For subcommands use `.`.\u003cbr\u003e\nAttached methods should return `boolean` (`true` for success, `false` for failure) and receive `CommandContext` as the first argument.\u003cbr\u003e\nAnnotation `@Optional` can be used to mark the parameter as an optional argument. **It should not be primitive.**\n\n#### Example\n```java\npublic class ExampleExecutor {\n    @CommandFor(\"foo.bar\")\n    public boolean executeBar(CommandContext ctx, int number) {\n        // omitted\n    }\n    @CommandFor(\"foo.baz\")\n    public boolean executeBaz(CommandContext ctx, @Optional String name) {\n        // omitted\n    }   \n}\n```\n\n### Registering\nConsoled uses [Services API](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/plugin/ServicesManager.html) to provide its functions.\u003cbr\u003e\nFollowing code gets a `CommandService` instance to register commands to.\n```java\nvar registration = Bukkit.getServiceManager().getRegistration(CommandService.class);\nCommandService service = registration.getProvider();\n```\nThen you can register all commands in your `plugin.yml` and executors with:\n```java\nExamplePlugin plugin;\nExampleExecutor executor;\nservice.register(plugin);\nservice.registerExecutor(plugin, executor);\n```\n\nCompiling\n------\n### Windows\n`gradlew jar`\n### Linux, BSD, or Mac OS X\n`./gradlew jar`\n\nYou can find `consoled-version.jar` in `build/libs`.\n\nContributions\n------\nConsoled welcomes all contributions! Feel free to contribute with PRs after enough tests done.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwiyou%2Fconsoled","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwiyou%2Fconsoled","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwiyou%2Fconsoled/lists"}