Create: Steam 'n' Rails

Create: Steam 'n' Rails

20M Downloads

Server crash after force-load MixinTrainHatOffsets.java

SrRapero720 opened this issue ยท 3 comments

commented

Mod: Steam_Rails-1.18.2-1.0.6.jar
Forge: 40.2.0
Create: 0.5.0h

Little Explain: I am making a Mixin Cache clear (like MemoryLeakFix of fabric) in forge.
So to do that i load all mixins and clear cache to use less memory.

But one of your mixins causes problems with the mod after trying to load it:

@Mixin(value = TrainHatOffsets.class, remap = false)
public class MixinTrainHatOffsets {
@Inject(at = @At("HEAD"), method = "getOffset", cancellable = true)
private static void inj$getOffset(EntityModel<?> model, CallbackInfoReturnable<Vec3> cir) {
if (model instanceof ConductorEntityModel) {
cir.setReturnValue(new Vec3(0f, -1f, 0f));
}
}
}

Here is the crash report
crash-2023-01-23_00.19.06-server.txt

The problem is i dont know how to fix it (in my mod or your mod).

commented

I no found the mixin json file in repo, so i dont know if this mixin its apply on both sides (because only crash on server but no client, and i do the same thing on both)

So probably adding a @OnlyIn(Dist.CLIENT) on the top solves it (i can't test because my internet is too bad and download all mod code + dependencies can become a hell)

I expect no cause troubles, because all clases involved in mixin are Suscribed to Client methods

commented

Whoops, this should have been in client mixins. fixed in next release

commented

consider to upload to repo the mixins.rails.json pls, i never found file to see the problem before.
and thanks :)