⁠
joe: Include much more detail in inspection descriptions
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- Reports when an @Inject is better written as an @Overwrite, because the @Inject always cancels and could cause silent mod incompatibilities
- </body>
- </html>
- <!--
- Minecraft Development for IntelliJ
-
- https://mcdev.io/
-
- Copyright (C) 2026 minecraft-dev
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation, version 3.0 only.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
- -->
-
- <html>
- <body>
- <p>
- Reports when an <code>@Inject</code> can be written as an <code>@Overwrite</code>
- </p>
- <!-- tooltip end -->
- <p>
- Such an <code>@Inject</code> effectively replaces the target method, so any other mod's injectors into the target method
- silently stop working. An <code>@Overwrite</code> makes this explicit, and Mixin reports conflicts between overwrites.
- </p>
- <pre><code>
- // bad
- @Inject(method = "getSpeed", at = @At("HEAD"), cancellable = true)
- private void getSpeed(CallbackInfoReturnable<Float> cir) {
- cir.setReturnValue(2.0f);
- }
-
- // good
- /**
- * @author MyMod
- * @reason Double the speed
- */
- @Overwrite
- public float getSpeed() {
- return 2.0f;
- }
- </code></pre>
- </body>
- </html>