Comments (5)
Please stop guessing what the issue is, it's not helpful. Just state the problem and leave it at that.
It's quite simple: mixins cannot transform mods because they are not on the classpath at the transition to the DEFAULT
Environment, when those configs are loaded and the metadata generation pass occurs. Allowing this to happen would require another Environment Phase to be added. Since this cannot be done in a platform-agnostic way, it would require the additon of arbitrary Environments (or at least some pre-defined ones), which is not impossible but is not going to be a priority to implement because in order to implement it neatly it obviously needs some extra infrastructure.
I'm going to officially state for the moment that transforming mods is currently not supported, but will be supported at some time in the future.
from mixin.
I just realise that the problem is this:
@Mixin(TileTurtle.class)
When the classloader loads the above. It will try to look for TileTurtle.class
The problem is that the class does not exist yet. A solution would be:
@Mixin(targets = "dan200/computercraft/shared/turtle/blocks/TileTurtle", remap = false)
Only problem is that the mixin compiler doesn't allow this:
MixinTileTurtle.java:14: error: Mixin target dan200/computercraft/shared/turtle/blocks/TileTurtle is public and must be specified in value
Edit: just tried that with removing the errors. And the result is the same 😟.
Edit2: I temporary fixed it by converting normal mods to coremods. Sadly enough it requires to crash the server on initial setup. https://gist.github.com/thomas15v/1c0fd9919198f1eb7775
EDIT3: I think I found the issue. Mixins tries to get the bytecode of all the classes in his config on load. Problem is that the class I need to modify isn't in the classpath on initiation. And also will never be. As mod classes only get loaded if they got trough all the IClassTransformers.
from mixin.
Oke 😟. I will currently will just convert normal mods to coremods in order to patch them. Somehow forge doesn't really seems to care if the mods are already in the classpath or not. But I have to say. Mod modification support would definitely help out a lot of modded server communities. As ASM and reflection are mostly their only hope, unless they want to ban the specific modded items.
But I understand, it doesn't really add much to the sponge project and it is probably a lot of work to make it work to. Not to mention that it might break compatibility with SpongeVanilla... .
from mixin.
But I understand, it doesn't really add much to the sponge project and it is probably a lot of work to make it work to. Not to mention that it might break compatibility with SpongeVanilla... .
It's not that really, I mean there are other use-cases for additional environment phases. It's just that they're not particularly high priority and as I said it needs careful planning in order to not become messy.
from mixin.
I just leave this for people who also have this problem and want to mix non-coremods. To make normal mods available in the DEFAULT Environment all you have to do is this: https://github.com/densitycraft/Glue/blob/master/src/main/java/com/densitycraft/glue/loader/PatchLoader.java#L55-L58.
Please note that the CoreModManager.getReparseableCoremods().add(jar.getName());
is important to make sure that forge rechecks the jar for modded content and doesn't reload it in the classpath.
from mixin.
Related Issues (20)
- [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
- Thread: Render thread Suspected Mod: Patchouli (patchouli), Version: 1.20.1-83-FORGE HOT 1
- Allow `@ModifyVariable` to capture locals HOT 1
- Mixins Not Being Read, Force Disabling Them. Game Crashes. HOT 1
- Trying to add another 'case' value to a 'switch' statement
- injection failed HOT 1
- INVOKE_ASSIGN gets stopped by CHECKCASTs HOT 2
- Wiki Subsection Titles
- [Forge] Stack Overflow when a invoked method is called HOT 1
- Support ModLauncher loaded as JPMS Module / Classes-Folder
- Initializer merging behavior seems to have changed in 0.8.6 snapshots HOT 1
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.