Code Monkey home page Code Monkey logo

Comments (5)

Mumfrey avatar Mumfrey commented on May 12, 2024 1

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.

thomas15v avatar thomas15v commented on May 12, 2024

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.

thomas15v avatar thomas15v commented on May 12, 2024

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.

Mumfrey avatar Mumfrey commented on May 12, 2024

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.

thomas15v avatar thomas15v commented on May 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.