Core Mod conflict
Dominance opened this issue ยท 6 comments
Similar to #19 When installed along side GalactiCraft 1,7.4
https://pastebin.com/CAzfxzHY
https://pastebin.com/FqfjMSuN
Works its way down alphabetically until the next mod uses said class.
See micdoodle8/Galacticraft#3355 (comment)
I think SereneSeasons is crashing in EntityRendererTransformer
if the method has already been transformed by another mod. A try ... catch
might fix this at least to allow the game to start.
If it helps our transformer is making this change around 24 instructions in to the bytecode:
aload_0
getfield buq/j Ljava/util/Random;
aload_0
getfield buq/m I
i2l
ldc2_w 312987231
lmul
invokevirtual java/util/Random/setSeed(J)V
becomes
aload_0
getfield buq/j Ljava/util/Random;
aload_0
getfield buq/m I
fload_1
invokestatic micdoodle8/mods/galacticraft/core/TransformerHooks/addRainParticles(Ljava/util/Random;IF)V
return
and then followed by the rest of the bytecode that was there previously, but it doesn't matter because all that comes after the return
instruction.
So the method becomes:
private void addRainParticles()
{
float f = this.mc.world.getRainStrength(1.0F);
if (!this.mc.gameSettings.fancyGraphics)
{
f /= 2.0F;
}
if (f != 0.0F)
{
micdoodle8/mods/galacticraft/core/TransformerHooks/addRainParticles(this.random, this.rendererUpdateCount, f);
return;
}
}
Our addRainParticles()
method then reproduces the vanilla code from EntityRenderer.addRainParticles()
, except in situations where we override it on Galacticraft worlds.
Obviously our version of the vanilla code is not going to have your transforms, even once this crash issue is overcome. I guess I should do this differently, we could instead maybe tack a call to our code inside the line
if (f != 0.0F)
so it becomes
if (f != 0.0F && !micdoodle8/mods/galacticraft/core/TransformerHooks/addRainParticles(this.rendererUpdateCount, f))
I'll try that within the next few days, see if it improves things - you may still have an issue with your ASM transformer but like I say, even when that issue is resolved we don't want to be disabling your code when Galacticraft is installed, so I do need to change this.
I made the changes mentioned.
The problem seems fixed, testing SereneSeasons-1.12.2-1.1.5 with Galacticraft 4.0.1.176. :)
I like your mod BTW, nice ideas. I was hoping that I could quickly test all the seasons using the `/time set' command jumping forward a few days, but that didn't seem to change anything?
Seasons use a separate timer for a variety of reasons. Using /time set wouldn't work even if we did go by global world time though, since it resets it back to 0. Anyway, guess this can be closed now.