diff --git a/src/main/java/io/wispforest/owo/mixin/ext/ItemStackMixin.java b/src/main/java/io/wispforest/owo/mixin/ext/ItemStackMixin.java index 6792224d..47cb50b9 100644 --- a/src/main/java/io/wispforest/owo/mixin/ext/ItemStackMixin.java +++ b/src/main/java/io/wispforest/owo/mixin/ext/ItemStackMixin.java @@ -35,21 +35,25 @@ private void injectDerivedComponentMap(ItemConvertible item, int count, Componen // TODO: for some reason mixin doesn't like it if I put all the injects in one method. @Inject(method = "(Lnet/minecraft/item/ItemConvertible;ILnet/minecraft/component/ComponentMapImpl;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;postProcessComponents(Lnet/minecraft/item/ItemStack;)V", shift = At.Shift.AFTER)) private void deriveComponents1(ItemConvertible item, int count, ComponentMapImpl components, CallbackInfo ci) { + if (owo$derivedMap == null) return; owo$derivedMap.derive((ItemStack)(Object) this); } @Inject(method = "applyChanges", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;postProcessComponents(Lnet/minecraft/item/ItemStack;)V", shift = At.Shift.AFTER)) private void deriveComponents2(ComponentChanges changes, CallbackInfo ci) { + if (owo$derivedMap == null) return; owo$derivedMap.derive((ItemStack)(Object) this); } @Inject(method = "applyUnvalidatedChanges", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;postProcessComponents(Lnet/minecraft/item/ItemStack;)V", shift = At.Shift.AFTER)) private void deriveComponents3(ComponentChanges changes, CallbackInfo ci) { + if (owo$derivedMap == null) return; owo$derivedMap.derive((ItemStack)(Object) this); } @Inject(method = "applyComponentsFrom", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;postProcessComponents(Lnet/minecraft/item/ItemStack;)V", shift = At.Shift.AFTER)) private void deriveComponents4(ComponentMap components, CallbackInfo ci) { + if (owo$derivedMap == null) return; owo$derivedMap.derive((ItemStack)(Object) this); } }