{"id":15531460,"url":"https://github.com/squiddev/forgelint","last_synced_at":"2025-04-06T00:11:51.575Z","repository":{"id":81349649,"uuid":"103142576","full_name":"SquidDev/forgelint","owner":"SquidDev","description":"Static analysis for Forge mods","archived":false,"fork":false,"pushed_at":"2018-05-24T10:07:31.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T06:21:20.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SquidDev.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-09-11T13:57:29.000Z","updated_at":"2019-05-03T11:16:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a7fd567-e4cf-4a9e-9a5c-2cc4c680079f","html_url":"https://github.com/SquidDev/forgelint","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/SquidDev%2Fforgelint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Fforgelint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Fforgelint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SquidDev%2Fforgelint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SquidDev","download_url":"https://codeload.github.com/SquidDev/forgelint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"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-02T11:26:17.143Z","updated_at":"2025-04-06T00:11:51.569Z","avatar_url":"https://github.com/SquidDev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# forgelint\nPrimitive static analysis for Forge mods\n\n## Features\n - Warn when using client-/server-only functionality, when not annotated with `@SideOnly`.\n\n## Example\n```java\npublic class ExampleItem extends Item {\n\t@SideOnly(Side.CLIENT)\n\tprivate RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();\n\t//                              ^\n\t// warning: Using a CLIENT class, but this could be either server or client\n\n\t@Nonnull\n\t@Override\n\tpublic String getUnlocalizedName(ItemStack stack) {\n\t\tif (hasEffect(stack)) {\n\t\t//  ^\n\t\t// warning: Using a CLIENT method, but this could be either server or client\n\t\t\treturn \"item.\" + getUnlocalizedName() + \".effect\";\n\t\t} else {\n\t\t\treturn \"item.\" + getUnlocalizedName() + \".no_effect\";\n\t\t}\n\t}\n\t\n\t@Nonnull\n\t@Override\n\tpublic ActionResult\u003cItemStack\u003e onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {\n\t\tif (world.isRemote) {\n\t\t\tworld.spawnParticle(EnumParticleTypes.CRIT_MAGIC, false, player.posX, player.posY, player.posZ, 0, 0, 0);\n\t\t\t// No warning: world.isRemote acts as a guard\n\t\t}\n\n\t\treturn new ActionResult\u003c\u003e(EnumActionResult.SUCCESS, player.getHeldItem(hand));\n\t}\n\t\n\t@Override\n\tpublic boolean shouldRotateAroundWhenRendering() {\n\t\t//         ^\n\t\t// Note: Overriding a CLIENT method, but no @SideOnly annotation\n\t\treturn true;\n\t}\n}\n```\n\n## Usage\nAdd this to your `build.gradle`:\n\n```groovy\nrepositories { maven { url 'https://dl.bintray.com/squiddev/maven' } }\ndependencies { provided \"org.squiddev:forgelint:0.1.0\" }\ncompileJava { options.compilerArgs += [\"-Xplugin:ForgeLint\"] }\n```\n\n## Planned features\n - Detect non-server-thread manipulation of the world.\n - Smarter control flow handling, meaning we don't require `@SideOnly` on private methods. \n\n## See also\nThe [MinecraftDev](https://github.com/minecraft-dev/MinecraftDev) plugin also provides a sidedness checker. The plugin\nis slightly more lenient than ForgeLint in some of its warnings, but is integrated into the editor which provides a \nnicer experience.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquiddev%2Fforgelint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquiddev%2Fforgelint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquiddev%2Fforgelint/lists"}