{"id":23102471,"url":"https://github.com/404setup/irs","last_synced_at":"2026-02-24T05:49:05.819Z","repository":{"id":267716588,"uuid":"901978829","full_name":"404Setup/irs","owner":"404Setup","description":"A bad Spigot/Folia scheduler wrapper.","archived":false,"fork":false,"pushed_at":"2025-02-07T07:43:45.000Z","size":133,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T21:15:15.868Z","etag":null,"topics":["fluent-interface","folia","paper","scheduler","spigot"],"latest_commit_sha":null,"homepage":"https://central.sonatype.com/artifact/one.tranic/irs","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/404Setup.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,"zenodo":null}},"created_at":"2024-12-11T17:08:39.000Z","updated_at":"2025-04-22T12:10:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"92355bb6-96ec-4b66-bf56-f6b12aa87392","html_url":"https://github.com/404Setup/irs","commit_stats":null,"previous_names":["404setup/irs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/404Setup/irs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404Setup%2Firs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404Setup%2Firs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404Setup%2Firs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404Setup%2Firs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/404Setup","download_url":"https://codeload.github.com/404Setup/irs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/404Setup%2Firs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29773669,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fluent-interface","folia","paper","scheduler","spigot"],"created_at":"2024-12-16T23:59:46.623Z","updated_at":"2026-02-24T05:49:05.788Z","avatar_url":"https://github.com/404Setup.png","language":"Java","readme":"# IRScheduler\n\n[![Maven Central Version](https://img.shields.io/maven-central/v/one.tranic/irs)](https://central.sonatype.com/artifact/one.tranic/irs) \n[![javadoc](https://javadoc.io/badge2/one.tranic/irs/javadoc.svg)](https://javadoc.io/doc/one.tranic/irs)\n\nUse Fluent Interface Design Pattern to provide uniform and fast scheduling tools for Spigot/Folia.\n\n## About the Scheduler\nIrs is compatible with Folia, but this is not a reason to abuse the scheduler.\n\nThere are three schedulers in Folia: `GlobalRegionScheduler`, `AsyncScheduler`, and `EntityScheduler`.\n\nBoth `Bukkit.getScheduler()` and `new BukkitRunnable().run()` that were available in Spigot and \nPaper are no longer available.\n\nTo learn more, see the Folia [project description](https://github.com/PaperMC/Folia#thread-contexts-for-api).\n\n## Install\nIrs are published to a central repository and can be imported without adding additional repositories.\n\n`maven`\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eone.tranic\u003c/groupId\u003e\n    \u003cartifactId\u003eirs\u003c/artifactId\u003e\n    \u003cversion\u003e1.3.3.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n`Gradle (Groovy)`\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation 'one.tranic:irs:1.3.3.2'\n}\n```\n\n`Gradle (Kotlin DSL)`\n```kotlin\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"one.tranic:irs:1.3.3.2\")\n}\n```\n\n## Shadow Jar Relocation Guide\n\nWhen using the Irs library in a plugin, it is essential to relocate its dependencies \nto prevent conflicts with other plugins that might also include the same library.\nHere is a guide to set up relocation.\n\n### Gradle Shadow Plugin\n\n#### Step 1: Add Shadow Plugin\nAdd the Shadow plugin to your `build.gradle` file.\n\n`Gradle (Groovy)`:\n```groovy\nplugins {\n    id 'com.gradleup.shadow' version '8.3.5'\n}\n```\n\n`Gradle (Kotlin DSL)`:\n```kotlin\nplugins {\n    id(\"com.gradleup.shadow\") version \"8.3.5\"\n}\n```\n\n#### Step 2: Configure Relocation\n\nConfigure the Shadow plugin to relocate the `one.tranic.irs` package.\nThis ensures that the Irs library’s classes do not conflict with other plugins.\n\n`Gradle (Groovy)`:\n```groovy\nshadowJar {\n    relocate 'one.tranic.irs', 'your.plugin.shadow.irs'\n}\n```\n\n`Gradle (Kotlin DSL)`:\n```kotlin\ntasks.shadowJar {\n    relocate(\"one.tranic.irs\", \"your.plugin.shadow.irs\")\n}\n```\n\n#### Step 3: Build the Relocated Jar\n\nRun the Shadow task to build your plugin with the relocated dependencies:\n```bash\ngradle shadowJar\n```\n\nThe resulting jar file in the `build/libs` directory will include the relocated Irs library, \navoiding classloader conflicts.\n\n#### Step 4: Verify Relocation\n\nTo ensure that relocation works as intended, decompile the built jar and verify that the \n`one.tranic.irs` package has been renamed to `your.plugin.shadow.irs` or your specified relocation path.\n\n### Maven Shade Plugin\n\nFor Maven users, you can use the Maven Shade Plugin to achieve relocation.\n\n#### Step 1: Add Maven Shade Plugin\nInclude the Maven Shade Plugin in your `pom.xml`:\n\n```xml\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n            \u003cartifactId\u003emaven-shade-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e3.4.1\u003c/version\u003e\n            \u003cexecutions\u003e\n                \u003cexecution\u003e\n                    \u003cphase\u003epackage\u003c/phase\u003e\n                    \u003cgoals\u003e\n                        \u003cgoal\u003eshade\u003c/goal\u003e\n                    \u003c/goals\u003e\n                    \u003cconfiguration\u003e\n                        \u003crelocations\u003e\n                            \u003crelocation\u003e\n                                \u003cpattern\u003eone.tranic.irs\u003c/pattern\u003e\n                                \u003cshadedPattern\u003eyour.plugin.shadow.irs\u003c/shadedPattern\u003e\n                            \u003c/relocation\u003e\n                        \u003c/relocations\u003e\n                    \u003c/configuration\u003e\n                \u003c/execution\u003e\n            \u003c/executions\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\n#### Step 2: Build the Relocated Jar\n\nRun the Maven package command:\n```bash\nmvn clean install\n```\n\nThe resulting jar file in the `target` directory will include the relocated Irs library.\n\n#### Step 3: Verify Relocation\n\nAs with Gradle, decompile the jar and confirm that the `one.tranic.irs` package has been \nrelocated to `your.plugin.shadow.irs` or the specified path.\n\n---\n\nBy following this guide, you can safely include the Irs library in your project without \nworrying about conflicts with other plugins.\n\n## Usage\nIRS tries to allow developers to use a set of codes to adapt to spigot and folia,\nbut in fact, developers also need to dispatch tasks to the correct scheduling instead of blind selection.\nIRS is not so intelligent.\n\n### Select the scheduler\nI need to modify the data near an entity: `RegionScheduler` or `EntityScheduler`\n\nI need to modify the weather: `GlobalRegionScheduler`\n\nI need to get updates for my plugin, or other tasks that do not operate in the world: `AsyncScheduler` or CustomThread\n\n### GlobalRegion Scheduler\n```java\nPluginSchedulerBuilder.builder(this)\n    .sync() // Starting at 1.3, Sync is the default behavior.\n    .task(task)\n    .run();\n\n// In Spigot/Paper\nBukkit.getScheduler().runTask(this, task);\n\n// In Folia\nBukkit.getGlobalRegionScheduler().run(this, (e)-\u003e task.run());\n```\n\n### Entity Scheduler\n```Java\nPluginSchedulerBuilder.builder(this)\n    .sync(entity)\n    .sync(player) // Yes, players can also use.\n    .task(task)\n    .run();\n\n// In Spigot/Paper\nBukkit.getScheduler().runTask(this, task);\n\n// In Folia\nentity.getScheduler().run(this, (e) -\u003e task.run(), null);\n```\n\n### Region Schduler\n```java\nPluginSchedulerBuilder.builder(this)\n    .sync(entity.getLocation())\n    .sync(location) // or\n    .task(task)\n    .run();\n\n// In Spigot/Paper\nBukkit.getScheduler().runTask(this, task);\n\n// In Folia\nBukkit.getRegionScheduler().run(this, location, (e) -\u003e task.run());\n```\n\n### Async Scheduler\n```java\nPluginSchedulerBuilder.builder(this)\n    .async()\n    .task(task)\n    .run();\n\n// In Spigot/Paper\nBukkit.getScheduler().runTaskAsynchronously(this, task);\n\n// In Folia\nBukkit.getAsyncScheduler().runNow(this, (e) -\u003e task.run());\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F404setup%2Firs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F404setup%2Firs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F404setup%2Firs/lists"}