Comments (8)
Honestly, this seems like the best way to approach this.
from mixin.
Since it's the one outstanding issue but nobody's commented, I was thinking of just either going ahead with this plan or just closing the issue until an actual use-case appeared and I got bugged into adding something like this anyway.
The two choices for implementation basically are:
- Add an extra array of strings to the
@Mixin
annotation - Add an alternate version of
@Mixin
(eg.@PrivateMixin
) which is identical in every way but just takes strings instead of class references.
from mixin.
Would PrivateMixin error if a mixin could have been used instead?
from mixin.
That would make sense.
from mixin.
I think a String[] targets()
would be fine here, unless private-class specific parameters are needed there's not much reason to use another annotation.
from mixin.
No particular reason, and programmatically it makes no odds either way, the complexity is pretty much exactly equal whether it's an extra property or an extra annotation.
Really it's just nicer that the value
property is default if no other properties are specified and just leads to the slightly nicer
@PrivateMixin("some.target.Clazz")
public abstract class SomeClazzMixin {
versus
@Mixin(targets = "some.target.Clazz")
public abstract class SomeClazzMixin {
So there's that. Basically since annotation properties when being parsed with ASM or AP are all dynamic lookups anyway, it doesn't really make any odds either way since neither code will actually care what the actual annotation passed in is, as long as it has the relevant keys.
from mixin.
Lets go with option 2 for the sake of the users
@Mixin(targets = "some.target.Clazz")
public abstract class SomeClazzMixin {
from mixin.
Alrighty then!
from mixin.
Related Issues (20)
- Mixin fails if `FileObject.toUri()` doesn't represent a real file. HOT 1
- Incompatible with Java 20 HOT 1
- Serverside Mixin Application failed HOT 1
- 1.19.2 Crash HOT 1
- Apply mixins to non- obfuscated methods in obfuscated targets, HOT 1
- The game crashed whilst initializing game (1.12.2) HOT 1
- How can i add "notch" data to my mixin refmap? (Minecraft 1.16.5) HOT 1
- Mixin Issues compatitibilty with recipes mixing HOT 1
- Crashing when activate dropper with item HOT 1
- Change code in a non-standard location in a method HOT 2
- [Question] Modifying existing Bytecode via Mixin HOT 3
- Can't inject a method from another mod HOT 1
- Can't mixin into ClassLoader? HOT 3
- Call mixed-in method or get mixed-in field HOT 3
- Cannot find target for @Shadow field HOT 1
- `Accessor` and `Invoker` Mixins delete methods with the same name in the target class
- java.lang.NoClassDefFoundError: org/spongepowered/asm/synthetic/args/Args$1 HOT 1
- [Feature Request] Inject goto instructuion
- [Forge][Build error] Using class from custom lib in Mixin class throw Exception
- `MappingWriterTSrg` is named incorrectly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mixin.