Slimefun4 icon indicating copy to clipboard operation
Slimefun4 copied to clipboard

Machines find it difficult to find recipes for similar items

Open lijinhong11 opened this issue 11 months ago • 12 comments

❗ Checklist

  • [X] I am using the official english version of Slimefun and did not modify the jar.
  • [X] I am using an up to date "DEV" (not "RC") version of Slimefun.
  • [X] I am aware that issues related to Slimefun addons need to be reported on their bug trackers and not here.
  • [X] I searched for similar open issues and could not find an existing bug report on this.

📍 Description

When I was testing my addon, I found this problem. And, the bug has existed for more than 5 months.

If a recipe needs [64,32] (total 64+32 = 96 items), the machine(s) can't find the recipe, but I place the items like [32,64], it works. However, it still can find the recipe, but if you place items like [64,64], machine(s) can't find the recipe again.

📑 Reproduction Steps

1.The recipe needs items that amount >64 (but not a multiple of 64) 2.place similar items like [64,64] in machines' input slots 3.Machines doesn't take items

💡 Expected Behavior

The machines will take 96 items and there's only 32 items in the input slots

📷 Screenshots / Videos

653ee832166478c65b426b5625b1d258 12be32879ac2d7f4293ef94d9ba62c0a

https://github.com/Slimefun/Slimefun4/assets/62691956/6297bd1c-bfa6-4b9a-b9ae-5a1b0f79265e

📜 Server Log

No response

📂 /error-reports/ folder

No response

💻 Server Software

Paper

🎮 Minecraft Version

1.20.x

⭐ Slimefun version

d3c1b819574d70c7f6b1579e3f899559

🧭 Other plugins

Slimefun and its addons

lijinhong11 avatar Mar 31 '24 05:03 lijinhong11

We're going to need some more programming specifics, what class are you using for this, I'm assuming AContainer but you need to specify. Those kinds of things. Excerpts of code would also make this a much easier process.

JustAHuman-xD avatar Mar 31 '24 06:03 JustAHuman-xD

We're going to need some more programming specifics, what class are you using for this, I'm assuming AContainer but you need to specify. Those kinds of things. Excerpts of code would also make this a much easier process.

the class extends AContainer and actually i don't rewrite the findNextRecipe method

lijinhong11 avatar Mar 31 '24 06:03 lijinhong11

In fact, the recipe cannot be set to two identical items in different positions, such as 1 diamond and 1 diamond, perhaps this is not related to the required quantity?

balugaq avatar Apr 05 '24 12:04 balugaq

This seems to be an issue with an addon. Im pretty sure the basic acontainer doesnt support more then 64 items for recipes. Do you have a example plugin where you tested this with?

J3fftw1 avatar Apr 14 '24 16:04 J3fftw1

is this an addon you created?

Boomer-1 avatar Apr 14 '24 16:04 Boomer-1

This seems to be an issue with an addon.

Im pretty sure the basic acontainer doesnt support more then 64 items for recipes.

Do you have a example plugin where you tested this with?

It supports [64,64]

JustAHuman-xD avatar Apr 14 '24 16:04 JustAHuman-xD

The issue is that the acontainer doesn't pick the "best" item stack for the recipe input, it picks the first that works, which means that if it's in a different order in the machine, it won't work

JustAHuman-xD avatar Apr 14 '24 16:04 JustAHuman-xD

is this an addon you created?

YES, and it is like SlimeCustomizer BUT I DONT MODIFY AContainer#findNextRecipe()

THE METHOD IS THE REAL PROBLEM

Also, for Justin, You should stack amount of similar items. That input like [1,1] can work too

lijinhong11 avatar Apr 15 '24 10:04 lijinhong11

YES, and it is like SlimeCustomizer BUT I DONT MODIFY AContainer#findNextRecipe()

THE METHOD IS THE REAL PROBLEM

Also, for Justin, You should stack amount of similar items. That input like [1,1] can work too

No need for the caps we understood it the first time when you said to earlier. And yeah [1,1] working doesn't surprise me since both would have the "best" match as long as the type/nbt was correct. However I have a feeling that it would not work if the machine only had [2,0] in it with a recipe of [1,1]

JustAHuman-xD avatar Apr 15 '24 11:04 JustAHuman-xD

YES, and it is like SlimeCustomizer BUT I DONT MODIFY AContainer#findNextRecipe() THE METHOD IS THE REAL PROBLEM Also, for Justin, You should stack amount of similar items. That input like [1,1] can work too

No need for the caps we understood it the first time when you said to earlier. And yeah [1,1] working doesn't surprise me since both would have the "best" match as long as the type/nbt was correct. However I have a feeling that it would not work if the machine only had [2,0] in it with a recipe of [1,1]

I saw someone use [4,4] and two input slots are far away lol

lijinhong11 avatar Apr 15 '24 11:04 lijinhong11

You should make a pr

J3fftw1 avatar Apr 18 '24 11:04 J3fftw1

Bump for let #4177 being reviewed

lijinhong11 avatar May 03 '24 12:05 lijinhong11