Open Craluminum2413 opened 3 years ago
buckets aren't supposed to stack.
Do newly crafted buckets stack? Maybe that should be fixed then.
If they are not supposed to stack, then why they are stacking?
It looks like they do not stack even without the intervention of liquids
Alright, since @sirStroam said they aren't supposed to stack, I'm reopening this issue.
Then may want to do a quick survey of other items that aren't supposed to stack to the limits they stack to when crafted in bulk through grid crafting and add them to a list here.
In your opinion, even completely empty buckets shouldn't be supposed to stack?
If you look at the JSON of something like stick you'll see maxstacksize: 64,
indicating it is supposed to stack to that amount. In the bucket JSON there isn't so the intent was for it to not stack.
But I just checked, that if maxstacksize
is missing, it set by default to 64
If it is true, then why clay bricks are stackable to 64, if they even don't have maxstacksize
in their file? You can look it by yourself:
\blocktypes\clay\brick.json
\blocktypes\clay\brickslab.json
\blocktypes\clay\brickstairs.json
\blocktypes\clay\chimney.json
and a lot of other blocks and items don't have in their files this value too
So in fact, if maxstacksize is missing, item/block always get default maxstacksize
as 64
Was able to reproduce in 1.15.3
Fixed in 1.16.0-pre.9
The issue is back in 1.16.0-rc.7, as reported in #1546 by @jollki.
Well, it never was fixed, I just confused it with maxStackSize (because bucket with maxStackSize as 1 completely fixes that issue)
Here's a bucket of milk that was emptied onto the ground with ctrl-right-click:
Here's that same bucket after it was placed on the ground and then picked up again:
I assume they don't stack because either emptying a bucket removes the contents
attribute when it should not, or placing the bucket on the ground adds the contents
attribute when it should not.
After doing some more testing, the issue is most likely that the contents
attribute is added when placing a bucket. Newly crafted buckets do not have that attribute. Also bowls and jugs, which don't have stacking issues, will not gain that attribute when placed.
Because bowls and jugs are not the same as buckets
Because bowls and jugs are not the same as buckets
Of course. But they do all use the contents
attribute. Which as far as I can see is the only difference between buckets that can't stack with each other. So if the contents
attribute is causing the issue, we need to determine what the correct behavior should be.
The contents
attribute is not present on newly crafted buckets/jugs/bowls and it's removed when a bucket/jug/bowl is emptied. The attribute is not added to jugs/bowls when they are placed but it is added to buckets when they are placed (or maybe when they are picked up). From that we can assume that the contents
attribute should not be added to placed buckets, rather than the other way around (that it should be present on new/emptied buckets).
Maybe I'm incorrect in assuming that this attribute is causing the stacking issues, but it does seem to be incorrect behavior for it to be added to placed buckets.
Attribute is not added to jugs/bowls when they placed because bucket is placed in completely different way than bowls or jugs. Bowls / jugs use GroundStorable behavior for "placing on the ground" plus they use BlockLiquidContainerTopOpened (such class can be used with GroundStorable behavior only), while bucket is something like the only super functional liquid container that uses default block placing, thus completely different way of placing, so I wouldn't compare them.
In short, bowls and jugs cannot be placed as block, while it is the only way for bucket, otherwise bucket interactions could be messed up.
I was not trying to say that jugs/bowls do (or should) use the same code path as buckets. It's exactly because they use different code that I'm comparing them. I'm saying that the jug/bowl code does the correct thing to the attributes of a placed jug/bowl, but the bucket code does the wrong thing.
But in reality all of that is irrelevant if my main assumption is incorrect. Does the contents
attribute added to placed buckets prevent them from stacking with buckets that do not have that attribute?
This issue is still there and still annoying! Buckets normally stack to 4 whether empty or full (of the same liquid). When a bucket is emptied, it will not stack reliably until all buckets are placed on the ground (empty) and then picked up in succession (which correctly stacks them to 4). Placing them apparently resets them to the default state. There is no reason for buckets not to stack as declared upthread. It's annoying enough to limit them to 4. OK, barrels don't stack because big, but buckets? Clearly, the 'empty the bucket' code is not clean or uniform.
Game Version: 1.14.8, 1.15.0-pre.11 Platform: Windows 10 Modded: No
Description
Emptied buckets don't stack with buckets that have been picked up
How to reproduce
Expected behavior
Buckets stacked