Netherite Plus Mod

Netherite Plus Mod

1M Downloads

@Redirect in HeldItemRenderer conflicts with other mods

RobertSkalko opened this issue ยท 1 comments

commented

I just found out my age of exile fabric mod redirects the same class as your mod in: https://github.com/OroArmor/Netherite-Plus-Mod/blob/26f8f86a5dce77a108b3698ffc96bf36ffe6cdcd/forge/src/main/java/com/oroarmor/multi_item_lib/mixin/render/HeldItemRendererMixin.java

We seem to both use it to render our bows. Mixin crashes if 2 mods use redirects on same method and require it.

I asked around on fabric discord and llama recommended me to use this instead:

`@Mixin(HeldItemRenderer.class)
public class HeldItemRendererMixin {

@ModifyVariable(
    method = "renderItem(FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider$Immediate;Lnet/minecraft/client/network/ClientPlayerEntity;I)V",
    at = @At(value = "STORE", ordinal = 0),
    ordinal = 0
)
private ItemStack modifyStack(ItemStack original) {
    return original.getItem() == Items.CARROT ? new ItemStack(Items.BOW) : original;
}

}`

You can use it too if you want, in case some other mod is also adding custom bows

commented

Cool, thanks for also figuring out how to solve it!