Skip to content
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

Api8/fix itemstack equalTo #3665

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

tyhdefu
Copy link
Contributor

@tyhdefu tyhdefu commented Apr 18, 2022

At the moment it uses ItemStack.tagMatches but that only compares the nbt, meaning:

ItemStack granite = ItemStack.of(ItemTypes.GRANITE);
ItemStack stone = ItemStack.of(ItemTypes.STONE);
ItemStack oak_plank = ItemStack.of(ItemTypes.OAK_PLANKS);
audience.sendMessage(Component.text("-- .equalTo --"));
audience.sendMessage(Component.text("Granite == Stone -> " + granite.equalTo(stone)));
audience.sendMessage(Component.text("Stone == Granite -> " + stone.equalTo(granite)));
audience.sendMessage(Component.text("Oak plank == Stone -> " + oak_plank.equalTo(stone)));

All yield true.
With this change, all are false, as well comparing the same item yielding true.

@Zidane Zidane merged commit 0717992 into SpongePowered:api-8 Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants