Slimefun / Slimefun4

Slimefun 4 - A unique Spigot/Paper plugin that looks and feels like a modpack. We've been giving you backpacks, jetpacks, reactors and much more since 2013.
GNU General Public License v3.0
943 stars 536 forks source link

fix AContainer can't find recipes with similar items #4172

Closed lijinhong11 closed 2 months ago

lijinhong11 commented 3 months ago

Description

4166

Proposed changes

Skip scanned slots

Related Issues (if applicable)

4166

Checklist

github-actions[bot] commented 3 months ago
Pro Tip! You can help us label your Pull Requests by using the following branch naming convention next time you create a pull request. ❤️ Branch naming convention Label
feature/** 🎈 Feature
fix/** ✨ Fix
chore/** 🧹 Chores
api/** 🔧 API
performance/** 💡 Performance Optimization
compatibility/** 🤝 Compatibility

If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! 👀

JustAHuman-xD commented 3 months ago

Have you tested this?

lijinhong11 commented 3 months ago

not :( but I will test later

lijinhong11 commented 3 months ago

Tested and it fixed with [64,64] ([64,32] may too)

JustAHuman-xD commented 3 months ago

If we could get another person to test and verify that'd be great!

github-actions[bot] commented 3 months ago

Slimefun preview build

A Slimefun preview build is available for testing! Commit: e021d694

https://preview-builds.walshy.dev/download/Slimefun/4172/e021d694

Note: This is not a supported build and is only here for the purposes of testing. Do not run this on a live server and do not report bugs anywhere but this PR!

JustAHuman-xD commented 3 months ago

If we could get another person to test and verify that'd be great!

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]

lijinhong11 commented 2 months ago

So there's the only way is to stack items' amount

JWJUN233233 commented 2 months ago

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.

lijinhong11 commented 2 months ago

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 GitHubhttps://github.com/Slimefun/Slimefun4/pull/4172#issuecomment-2080269033, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AO6JU5AF7VLD7TFDFGPJGPTY7LXBNAVCNFSM6AAAAABGNBY3Z2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBQGI3DSMBTGM. You are receiving this because you authored the thread.Message ID: @.***>

JWJUN233233 commented 2 months ago

and i wonder why not use hashcode. if the NBT of item is different from that in recipe, it shouldnt match.

JustAHuman-xD commented 2 months ago

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

JWJUN233233 commented 2 months ago

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?

JustAHuman-xD commented 2 months ago

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:

  1. the recipe calls for a diamond hoe, you have a diamond hoe that was used and then repaired, nbt won't be identical.

  2. You have a recipe that calls for fertilizer, the fertilizer has a custom model nbt because the server previously had a resource pack but now does not or the model number changed, nbt won't be identical

Etc etc

JWJUN233233 commented 2 months ago

thats so bad

JustAHuman-xD commented 2 months ago

thats so bad

?

JWJUN233233 commented 2 months ago

i created my pr #4177