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

Allow crafting jobs to be requested from conversion monitors #7109

Merged
merged 7 commits into from
May 18, 2023
Merged

Allow crafting jobs to be requested from conversion monitors #7109

merged 7 commits into from
May 18, 2023

Conversation

62832
Copy link
Member

@62832 62832 commented May 16, 2023

Closes #2821
TODO: Figure out why canCraft doesn't update upon removal/reinsertion of patterns

Closes #2821
TODO: Figure out why canCraft doesn't update upon removal/reinsertion of patterns
@Technici4n Technici4n self-assigned this May 17, 2023
TODO: fix text rendering not being affected by patterns until the network has a pattern provider added/removed
@62832 62832 marked this pull request as ready for review May 18, 2023 12:44
CraftAmountMenu.open((ServerPlayer) player, MenuLocators.forPart(this), itemKey,
itemKey.getAmountPerUnit());
}

this.extractItem(player, itemKey.getItem().getMaxStackSize());
Copy link
Member

Choose a reason for hiding this comment

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

else?

Copy link
Member Author

Choose a reason for hiding this comment

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

Didn't think it was necessary; if the item isn't craftable, we simply don't open the crafting request menu.

Copy link
Member

Choose a reason for hiding this comment

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

The problem is opening the menu and extracting the item. The item might be extractable even if it wasn't reported.

Copy link
Member Author

@62832 62832 May 18, 2023

Choose a reason for hiding this comment

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

Is that not already covered by extractItem when the amount is non-zero? I forgot.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see why extractItem would check getAvailableStacks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that I think about it, would it be better to move the menu opening call to within extractItem?

Copy link
Member

Choose a reason for hiding this comment

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

Right, that makes more sense. 👍

if (player.containerMenu != null) {
player.containerMenu.broadcastChanges();
}
player.containerMenu.broadcastChanges();
Copy link
Member

Choose a reason for hiding this comment

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

Why? Doesn't this cause a crash if the player is not in a menu?

Copy link
Member Author

Choose a reason for hiding this comment

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

The check was supposedly redundant due to containerMenu always being non-null at that point.

Copy link
Member

Choose a reason for hiding this comment

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

Why is it always non-null? extractItem is called when the player clicks the monitor to take an item, right?

@Technici4n Technici4n merged commit ef218ff into AppliedEnergistics:master May 18, 2023
@62832 62832 deleted the conversion-crafting branch May 18, 2023 19:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion Auto Crafting Function with Conversion Monitors
2 participants