-
-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IllegalArgumentException: Cannot copy null stack in ItemStackMixin_NeoForge #1550
Conversation
…n_NeoForge Fixes IllegalArgumentException: Cannot copy null stack reported in server logs.
@@ -64,7 +69,7 @@ public abstract class ItemStackMixin_NeoForge implements ItemStackBridge, IItemS | |||
} | |||
|
|||
@Deprecated | |||
public void setItem(Item item) { | |||
public void setItem(@Nullable Item item) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, there shouldn't be an ItemStack
with a null item, it should be Items.AIR
instead.
private int arclight$itemDamage(ServerLevel serverLevel, ItemStack itemStack, int i, @Local(ordinal = 0) LivingEntity damager) throws Throwable { | ||
// Added null check for itemStack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind figuring out which method passed a null as ItemStack
into this method?
In Minecraft modding, these should all be replaced by ItemStack,EMPTY
. If it happened in NeoForge, perhaps it was their bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure i will look into it asap
ignore my last pull request still looking into the matter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully this fixes the null issue. If it needs more than happy to work on it further.
Although I am still confused as to why the |
I think the root problem is in Arclight/arclight-common/src/main/java/io/izzel/arclight/common/mod/util/ArclightSpecialRecipe.java Line 21 in ab1e5d2
And I have solved it. |
Fixes IllegalArgumentException: Cannot copy null stack reported in server logs.