{"id":21580534,"url":"https://github.com/rchomczyk/honey","last_synced_at":"2025-04-10T18:34:44.063Z","repository":{"id":253154161,"uuid":"842632005","full_name":"rchomczyk/honey","owner":"rchomczyk","description":"A message library, which focuses on being extensible and flexible.","archived":false,"fork":false,"pushed_at":"2024-11-23T15:45:57.000Z","size":1293,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-11-23T16:32:20.330Z","etag":null,"topics":["adventure","bukkit","bukkit-api","dispatcher","java","kyori","message","minecraft","minimessage","notification","paper","papermc","placeholders","spigot","spigot-api"],"latest_commit_sha":null,"homepage":"","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/rchomczyk.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":"2024-08-14T18:39:20.000Z","updated_at":"2024-11-20T12:38:49.000Z","dependencies_parsed_at":"2024-08-14T20:37:37.234Z","dependency_job_id":"63bdfc15-4a64-4693-84bf-9d30290af1d4","html_url":"https://github.com/rchomczyk/honey","commit_stats":null,"previous_names":["rchomczyk-playground/honey","rchomczyk/honey"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rchomczyk%2Fhoney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rchomczyk%2Fhoney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rchomczyk%2Fhoney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rchomczyk%2Fhoney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rchomczyk","download_url":"https://codeload.github.com/rchomczyk/honey/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226172003,"owners_count":17584909,"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":["adventure","bukkit","bukkit-api","dispatcher","java","kyori","message","minecraft","minimessage","notification","paper","papermc","placeholders","spigot","spigot-api"],"created_at":"2024-11-24T14:08:49.590Z","updated_at":"2025-04-10T18:34:44.033Z","avatar_url":"https://github.com/rchomczyk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## honey (*miód*)\n\nA message library, which focuses on simplicity and flexibility.\n\n### Intent\n\n*honey* was created to allow for developers to create easily customizable messages for end users, by giving them flexibility with placeholders.\n\n### Get started\nYou can build dependency and append it to your local .m2 directory, by using:\n`./gradlew publishToMavenLocal`\n\n![test-plugin showcase](assets/image.png)\n\n### Use case (honey)\n\nA showcase of how to use *honey*, can be found in [honey-test-plugin](honey-test-plugin) module.\n\n#### With use of formatter\n\n*MessageFormatter* provides all functionality that honey offers, it comes with reflective placeholder\nevaluation and sanitization to make them harmless, while used with minimessage without any additional\nhasle on developer side.\n\n```java\nAdventureMessageDispatcher.createTitle()\n    .viewer(event.getPlayer())\n    .title(it -\u003e it.template(formatter, \"Hello!\"))\n    .subtitle(it -\u003e it.template(formatter, \"It is a pleasure to see you there {{player.getName}}\"))\n    .variable(\"player\", event.getPlayer())\n    .times(2, 4, 2)\n    .dispatch();\n\nAdventureMessageDispatcher.createChat()\n    .viewer(Bukkit.getServer())\n    .template(formatter, \"{{player.getName}} has joined the server!\")\n    .variable(\"player\", event.getPlayer())\n    .dispatch();\n\nAdventureMessageDispatcher.createActionBar()\n    .viewer(event.getPlayer())\n    .template(formatter, \"Honey is great, isn't it?\")\n    .dispatch();\n```\n\n#### Without formatter\n\n*MessageDispatcher* provides a way to send messages without the need of using placeholders.\n\n```java\nAdventureMessageDispatcher.createChat()\n    .viewer(Bukkit.getServer())\n    .template(Component.text(\"Somebody joined to the server!\").color(NamedTextColor.RED))\n    .dispatch();\n\nAdventureMessageDispatcher.createActionBar()\n    .viewer(event.getPlayer())\n    .template(Component.text(\"Honey is great, isn't it?\"))\n    .dispatch();\n```\n\n### Use case (honey-kt-extesion)\n```kotlin\nAdventureMessageDispatcher.createChat()\n    .viewer(event.player)\n    .template(Component.text(\"Hello!\"))\n    .dispatch()\n\nAdventureMessageDispatcher.createActionBar()\n    .viewer(event.player)\n    .template(Component.text(\"This is an action bar message!\"))\n    .dispatch()\n\nplayer.createChat()\n    .template(Component.text(\"A custom chat message\"))\n    .dispatch()\n\nplayer.createActionBar()\n    .template(Component.text(\"This is a custom action bar\"))\n    .dispatch()\n\nAdventureMessageDispatcher.createTitle()\n    .viewer(event.player)\n    .title { it.template(Component.text(\"Hello!\")) }\n    .subtitle { it.template(Component.text(\"It's great to see you!\")) }\n    .times(2, 4, 2)\n    .dispatch()\n```\n\n### Synchronous vs asynchronous message dispatching\n- [dispatch](https://github.com/rchomczyk/honey/tree/main/honey-common/src/dev/shiza/honey/message/dispatcher/MessageBaseDispatcher.java#L71)\n  This method immediately delivers the message synchronously. It calls the deliver function with the rendered message and the viewer, and the action is completed immediately.\n\n- [dispatchAsync](https://github.com/rchomczyk/honey/tree/main/honey-common/src/dev/shiza/honey/message/dispatcher/MessageBaseDispatcher.java#L76)\n  This method delivers the message asynchronously. It returns a CompletableFuture that performs the message rendering in the background and then delivers the result once it's ready. It allows non-blocking behavior and handles exceptions asynchronously.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frchomczyk%2Fhoney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frchomczyk%2Fhoney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frchomczyk%2Fhoney/lists"}