-
Notifications
You must be signed in to change notification settings - Fork 651
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
Allow crafting jobs to be requested from conversion monitors #7109
Conversation
Closes #2821 TODO: Figure out why canCraft doesn't update upon removal/reinsertion of patterns
TODO: fix text rendering not being affected by patterns until the network has a pattern provider added/removed
src/main/java/appeng/parts/reporting/ConversionMonitorPart.java
Outdated
Show resolved
Hide resolved
src/main/java/appeng/parts/reporting/ConversionMonitorPart.java
Outdated
Show resolved
Hide resolved
src/main/java/appeng/parts/reporting/ConversionMonitorPart.java
Outdated
Show resolved
Hide resolved
(see relevant code review and comments)
CraftAmountMenu.open((ServerPlayer) player, MenuLocators.forPart(this), itemKey, | ||
itemKey.getAmountPerUnit()); | ||
} | ||
|
||
this.extractItem(player, itemKey.getItem().getMaxStackSize()); |
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.
else
?
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.
Didn't think it was necessary; if the item isn't craftable, we simply don't open the crafting request menu.
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.
The problem is opening the menu and extracting the item. The item might be extractable even if it wasn't reported.
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.
Is that not already covered by extractItem
when the amount is non-zero? I forgot.
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.
I don't see why extractItem
would check getAvailableStacks
.
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.
Now that I think about it, would it be better to move the menu opening call to within extractItem
?
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.
Right, that makes more sense. 👍
if (player.containerMenu != null) { | ||
player.containerMenu.broadcastChanges(); | ||
} | ||
player.containerMenu.broadcastChanges(); |
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.
Why? Doesn't this cause a crash if the player is not in a menu?
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.
The check was supposedly redundant due to containerMenu
always being non-null at that point.
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.
Why is it always non-null? extractItem
is called when the player clicks the monitor to take an item, right?
Closes #2821
TODO: Figure out why canCraft doesn't update upon removal/reinsertion of patterns