{"id":15016015,"url":"https://github.com/minecraftforge/eventbus","last_synced_at":"2025-04-08T03:10:41.086Z","repository":{"id":33985764,"uuid":"136397019","full_name":"MinecraftForge/EventBus","owner":"MinecraftForge","description":"Event Bus","archived":false,"fork":false,"pushed_at":"2025-03-26T17:26:00.000Z","size":637,"stargazers_count":40,"open_issues_count":2,"forks_count":36,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-31T18:19:11.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/MinecraftForge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-header.txt","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},"funding":{"patreon":"LexManos"}},"created_at":"2018-06-06T23:36:39.000Z","updated_at":"2025-03-26T17:26:06.000Z","dependencies_parsed_at":"2023-01-15T03:49:39.053Z","dependency_job_id":"6e376876-0bf7-41fb-972e-fdf297b0e0b0","html_url":"https://github.com/MinecraftForge/EventBus","commit_stats":{"total_commits":129,"total_committers":10,"mean_commits":12.9,"dds":0.6589147286821706,"last_synced_commit":"f29ef3d81dee2bd1808f9e54354246b25ac1175d"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinecraftForge%2FEventBus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinecraftForge%2FEventBus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinecraftForge%2FEventBus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MinecraftForge%2FEventBus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MinecraftForge","download_url":"https://codeload.github.com/MinecraftForge/EventBus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"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-09-24T19:48:17.276Z","updated_at":"2025-04-08T03:10:41.068Z","avatar_url":"https://github.com/MinecraftForge.png","language":"Java","readme":"# EventBus\n\nA flexible, high-performance, thread-safe subscriber-publisher framework designed with modern Java in mind.\n\n## Overview\nThe core functionality of EventBus is to provide a simple and efficient way to handle events in a decoupled manner.\n\nEach event may have one or more buses associated with it, which are responsible for managing listeners and dispatching\ninstances of the event object to them. To maximise performance, the underlying implementation is tailored on the fly\nbased on the event's type, characteristics, inheritance chain and the number and type of listeners registered to the bus.\n\n## Quickstart guide\nFirst, add the Forge Maven repository and the EventBus dependency to your project:\n```gradle\nrepositories {\n    maven {\n        name = \"Forge\"\n        url = \"https://maven.minecraftforge.net\"\n    }\n}\n\ndependencies {\n    implementation \"net.minecraftforge:eventbus:\u003cversion\u003e\"\n}\n```\n\nYou can find the list of available versions [here][Versions].\n\nNow you can start using EventBus in your project. Simple usage example:\n```java\nimport net.minecraftforge.eventbus.api.event.RecordEvent;\nimport net.minecraftforge.eventbus.api.bus.EventBus;\n\n// Define an event and a bus for it\nrecord PlayerLoggedInEvent(String username) implements RecordEvent {\n    public static final EventBus\u003cPlayerLoggedInEvent\u003e BUS = EventBus.create(PlayerLoggedInEvent.class);\n}\n\n// Register an event listener\nPlayerLoggedInEvent.BUS.addListener(event -\u003e System.out.println(\"Player logged in: \" + event.username()));\n\n// Post an event to the registered listeners\nPlayerLoggedInEvent.BUS.post(new PlayerLoggedInEvent(\"Paint_Ninja\"));\n```\n\nBrowse the `net.minecraftforge.eventbus.api` package and read the Javadocs for more information. For real-world\nexamples, check out Forge's extensive use of EventBus [here][Forge usages].\n\n## Nullability\nThe entirety of EventBus' API is `@NullMarked` and compliant with the [jSpecify specification](https://jspecify.dev/) -\nthis means that everything is non-null by default unless otherwise specified.\n\nAttempting to pass a `null` value to a method param that isn't explicitly marked as `@Nullable` is an unsupported\noperation and won't be considered a breaking change if a future version throws an exception in such cases when it didn't\nbefore.\n\n## Contributing\nOne of the main goals of EventBus is performance. As such, any changes should be benchmarked with the `jmh` Gradle task\nto help ensure that there are no unintended performance regressions. If you are unsure how to do this or would like\nto discuss your ideas before submitting a PR, feel free to reach out to us on the [Forge Discord].\n\n[Versions]: https://files.minecraftforge.net/net/minecraftforge/eventbus/\n[Forge usages]: https://github.com/MinecraftForge/MinecraftForge/tree/1.21.x/src/main/java/net/minecraftforge/event\n[Forge Discord]: https://discord.minecraftforge.net/\n","funding_links":["https://patreon.com/LexManos"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminecraftforge%2Feventbus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminecraftforge%2Feventbus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminecraftforge%2Feventbus/lists"}