⁠
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 discouraged usages of shifting in injection points
- </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 discouraged usages of shifting in injection points
- </p>
- <!-- tooltip end -->
- <p>
- Shifting moves the injection point by a number of bytecode instructions, which depends on exactly how the target method was
- compiled and breaks easily when it changes. Shifting is allowed where it is commonly needed, for example shifting
- <code>INVOKE</code> and <code>FIELD</code> injection points to after the instruction.
- </p>
- <p>
- A common mistake is to use `Shift.BEFORE` on injection points that already target before, such as `INVOKE`. This results in
- the injection being shifted one instruction too early.
- </p>
- <pre><code>
- // bad
- @At(value = "INVOKE", target = "...", shift = At.Shift.BY, by = 3)
-
- // good
- @At(value = "INVOKE", target = "...", shift = At.Shift.AFTER)
- </code></pre>
- </body>
- </html>