Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the best & stable way to detect if OCC is installed or not? #741

Open
anatawa12 opened this issue Nov 15, 2021 · 1 comment
Open

Comments

@anatawa12
Copy link

Relates: fixrtm/fixRTM#365

Request

Can you let me know and dodunent the best & stable way to detect if OCC is installed before initialization of OCC's class transformers?

Context

fixRTM, a mod my me is currently incompatible with OCC because OCC depends on instantiation of EntityTrackerEntry in EntityTracker#track method (according to the following code) but fixrtm replaces it.

@Redirect(method = "track(Lnet/minecraft/entity/Entity;IIZ)V", at = @At(value = "NEW",
target = "net/minecraft/entity/EntityTrackerEntry"))

Fixrtm's replation of instantiation of EntityTrackerEntry is not depends on place so I want to suppress replacion in EntityTracker#track if OCC is installed and replace instantiation of EntityTrackerEntry of your mixin.
That's why I want to know how should I do to detect the OCC.

I want to detect between instantiation of OCC's coremod main class and initialization of OCC's class transformers. So I cannot use FML mod list and modid.

My Opinion

In my opinion, It's a good to check if the coremod main class is existing but I don't know if the io.github.opencubicchunks.cubicchunks.core.asm.coremod.CubicChunksCoreMod is stable for 1.12.2 so I don't want to use this way without clarification by developers of OCC.

@Barteks2x
Copy link
Member

Barteks2x commented Nov 15, 2021

Since you are going to depend on implementation details of CC anyway it's fine to just check whether that class exists. It's definitely more stable than the CC mixin you are interacting with. That said i probably can fix it on my side by replacing redirect with inject.

Leaving it open for now because i would like to attempt to fix it. I should be able to do it in about 2 weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants