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

Prevent removed mods' food from becoming air on read and crashes #10579

Open
wants to merge 1 commit into
base: version/main
Choose a base branch
from

Conversation

Thodor12
Copy link
Contributor

@Thodor12 Thodor12 commented Jan 7, 2025

Closes #10577

Changes proposed in this pull request

  • Verify each item is actually food before adding it back to the menu

Testing

  • Yes I tested this before submitting it.
  • I also did a multiplayer test.

Review please

@@ -205,7 +207,11 @@ public void deserializeNBT(final CompoundTag compound)
final ListTag minimumStockTagList = compound.getList(TAG_MENU, Tag.TAG_COMPOUND);
for (int i = 0; i < minimumStockTagList.size(); i++)
{
menu.add(new ItemStorage(ItemStack.of(minimumStockTagList.getCompound(i))));
final ItemStack itemStack = ItemStack.of(minimumStockTagList.getCompound(i));
if (ISFOOD.test(itemStack) || itemStack.getItem() instanceof IMinecoloniesFoodItem)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have somewhere a util call for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that I could find, no

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.

Client crashing when clicking on Food Menu in restaurant
2 participants