aboutsummaryrefslogtreecommitdiff
path: root/README.md
AgeCommit message (Collapse)Author
2021-03-14Add new @Pattern feature to centralize version-aware codeJonas Herzig
That is, most of the business code should not be aware that it is being compiled to multiple versions even when it heavily interacts with MC, preprocessor statements should be an escape hatch, not the norm. Similarly, code should not be forced to do `MCVer.getWindow(mc)` instead of the much more intuitive `mc.getWindow()`, and this new preprocessor (technically remap) feature makes this possible by defining "search and replace"-like patterns (but smarter in that they are type-aware) in one or more central places which then are applied all over the code base. In a way, this is another step in the automatic back-porting process where preprocessor statements are used when we cannot yet do something automatically. Previously we "merely" automatically converted between different mapping, this new feature now also allows us to automatically perform simple refactoring tasks like changing field access to a getter+setter (e.g. `mc.getWindow()`), or changing how a method is called (e.g. `BufferBuilder.begin`), or changing a method call chain (e.g. `dispatcher.camera.getYaw()`), or most other search-and-replace-like changes and any combination of those. The only major limitation is that the replacement itself is not smart, so arguments must be kept in same order (or be temporarily assigned to local variables which then can be used in any order).
2021-03-14Kotlin source remapping has indeed been supported for a while nowJonas Herzig
2019-06-17Re-write to use Intellij's PSI (via kotlin-compiler) instead of ECJJonas Herzig
Primarily for potential kotlin support. Secondarily, this allows us to drop the EPL (kotlin-compiler is ASL2.0). This also fixes an issue where redirect/inject methods with names identical to remapped names in the target class would get renamed. This also seems to implement the implicit member reference check (to prevent accidental name shadowing after remapping) more thoroughly, at least it finds some valid cases which the previous implementation has ignored.
2019-04-24Initial commitJonas Herzig