Any slab variant is miscalculated. (1.16.4)
SrBedrock opened this issue · 5 comments
Description
Any slab variant is miscalculated.
Correct calculation: 1 item = 2 slabs variants
Example with oak plank
-
Workbench: 6 packs of oak plank = 768 slabs of oak_plank
-
FastCraft: 6 packs of oak plank = 656 slabs of oak_plank
Server Details
-
Server:
Purpur version git-Purpur-952 (MC: 1.16.4) (Implementing API version 1.16.4-R0.1-SNAPSHOT)
-
FastCraft:
3.2.8
Crafting stone slabs with fastcraft: (60 x 2 = 90 slabs)
If you select 60 slabs, in the second craft the amount is less than 60 even though you have enough items to craft.
fastcraft-60.mp4
Crafting stone slabs with fastcraft: (6 x 21 = 126 slabs)
fastcraft-6.mp4
Crafting stone slabs with workbench: (126 slabs)
workbench.mp4
I played around with it a bit, and it looks like it can happen to basically any recipe that crafts >1 item
- Take sticks for example. Put 1 less than a full stack of sticks in your inventory (63).
- Set FastCraft's craft amount to craft >1x the normal amount (e.g. 8 instead of 4 sticks)
- Craft the sticks
There should be 64+7 sticks, but one is missing. Now to dive into the code to see what's causing this...
Fixed! Basically an ItemStack(4x stick) was being added to the inventory twice, but Bukkit was changing its size to 3 (and changing the 63 stack to 64) the first time, so the second time it was adding 3 instead of 4.