Injecting a method but forge needs the arguments in a different order than fabric
when run in forge createChild method in the VillagerEntity class wants the arguments in a different order than fabric has. I have tried switching the mixins around but nothing seems to work.
forge argument order:
void createChild(ServerWorld serverWorld, PassiveEntity passiveEntity, CallbackInfoReturnable<VillagerEntity> cir,double d,VillagerType villagerType,VillagerEntity Child)
Fabric argument order
void createChild(ServerWorld serverWorld, PassiveEntity passiveEntity, CallbackInfoReturnable<VillagerEntity> cir, VillagerType villagerType, double d, VillagerEntity Child)
Inject method it uses
@Inject(method = "createChild(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/passive/PassiveEntity;)Lnet/minecraft/entity/passive/VillagerEntity;", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/VillagerEntity;initialize(Lnet/minecraft/world/ServerWorldAccess;Lnet/minecraft/world/LocalDifficulty;Lnet/minecraft/entity/SpawnReason;Lnet/minecraft/entity/EntityData;Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/entity/EntityData;", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD,cancellable = true)
Don't use local capture (for this reason and others; they rely on the LVT being consistent and in the same order which is intrinsically brittle). Use mixinextra's @Local if you need a specific local https://github.com/LlamaLad7/MixinExtras/wiki/Local
Ok its fixed. Also when i try to launch this mod (the mod i made) on forge it loads normally but the Mixins won't work even though it works in the ide environment. it works in fabric tho