-
Notifications
You must be signed in to change notification settings - Fork 546
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 AContainer can't find recipes with similar items #4172
Conversation
Pro Tip!
If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! 👀 |
Have you tested this? |
not :( but I will test later |
Tested and it fixed with [64,64] ([64,32] may too) |
If we could get another person to test and verify that'd be great! |
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/4172/e021d694
|
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.
Just a code style (and kinda performance but just micro optimization) thing
@@ -422,6 +422,8 @@ protected MachineRecipe findNextRecipe(BlockMenu inv) { | |||
for (ItemStack input : recipe.getInput()) { | |||
for (int slot : getInputSlots()) { | |||
if (SlimefunUtils.isItemSimilar(inventory.get(slot), input, true)) { | |||
if (found.containsKey(slot)) continue; //skip scanned slots |
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.
You should invert this check and merge it with the surrounding of statement, have it be the first boolean expression
I want to make sure this doesn't somehow break any existing thing as I'm worried this might break a recipe that is setup as [32,32] and the slot setup is something like [1, 64] |
So there's the only way is to stack items' amount |
im afraid that it wont work. |
u r more excellent than me 🙁
…________________________________
发件人: Ddggdd135 ***@***.***>
发送时间: 2024年4月27日 08:34
收件人: Slimefun/Slimefun4 ***@***.***>
抄送: lijinhong11 ***@***.***>; Author ***@***.***>
主题: Re: [Slimefun/Slimefun4] fix AContainer can't find recipes with similar items (PR #4172)
im afraid that it wont work.
if there is a recipe a[Diamondx64] and a recipe b[Diamondx64, Iron_ingot] and there are 64 diamonds in the AContainer, it should match recipe a instead of b. i may give another solution later.
—
Reply to this email directly, view it on GitHub<#4172 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AO6JU5AF7VLD7TFDFGPJGPTY7LXBNAVCNFSM6AAAAABGNBY3Z2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBQGI3DSMBTGM>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
and i wonder why not use hashcode. if the NBT of item is different from that in recipe, it shouldnt match. |
Because there are tons of cases where nbt wouldn't be identical but the ingredient is still valid |
Could you please give an example? |
Sure! We already have problems with it in other areas so I can just give a couple of those:
Etc etc |
thats so bad |
? |
i created my pr #4177 |
Description
#4166
Proposed changes
Skip scanned slots
Related Issues (if applicable)
#4166
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values