[Bug] Nested Mixin Invokers cause issues.
jaredlll08 opened this issue ยท 3 comments
Versions
1.16 Vampirism Github Branch
Also 1.16 CraftTweaker branch (reproduced the error in my repo and by copying your mixin code into it)
-
Minecraft: 1.16
-
Forge: N/A (forge version literally doesn't matter in this case)
-
Vampirism: d2909c7
-
ModPack: N/A
Issue Description
Having a nested Invoker causes issues with class traversal as Mixin complains with:
org.spongepowered.asm.mixin.transformer.throwables.IllegalClassLoadError: de.teamlapen.vampirism.mixin.MixinAccessors is in a defined mixin package de.teamlapen.vampirism.mixin.* owned by vampirism.mixins.json and cannot be referenced directly
The code in question is here:
https://github.com/TeamLapen/Vampirism/blob/1.16/src/main/java/de/teamlapen/vampirism/mixin/MixinAccessors.java#L11-L17
Reproduce Steps
- Install Vampirism
- Install CraftTweaker
- Load a world
- Look at the CraftTweaker log file (
/ct log
) / game chat for the error.
Additional Information
Changing the code to instead be:
@Mixin(LivingEntity.class)
public interface LivingEntityExperienceAccessor {
@Invoker("getExperiencePoints")
int accessGetExperiencePoints(PlayerEntity player);
}
and not be nested inside of MixinAccessors
is the fix
Thank you for letting us know.
Does this issue break Crafttweaker completely or just the interaction with Vampirism or is it just some minor issue?
Just trying to decide if this is reasons enough to release a new Vampirism version hotfix version.
Thanks for the quick fix!
So as far as I know, there actually isn't any interactions / support with Vampirism that this could break (if you're interested in some CraftTweaker support though, just let me know).
Basically when we traverse classes to figure out what needs to be exposed to CraftTweaker, it was triggering the mixin access error (when we were looking at stuff in the LivingEntity class). It shouldn't break anything, but users will see a message in their chat and the CraftTweaker log file saying that it couldn't be registered.
Obviously a hotfix release would be nice, but to be honest it is a bit low priority, nothing breaks, just a message in chat.