anegostudios / VintageStory-Issues

Vintage Story's public issue tracker for reporting bugs, crashes and the like
46 stars 16 forks source link

Buckets don't stack when they should #862

Open Craluminum2413 opened 3 years ago

Craluminum2413 commented 3 years ago

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

  1. Get two empty wooden buckets
  2. Fill one bucket with any liquid and empty it, let's name it as bucket A
  3. Place another empty bucket on the surface and pick up it, let's name it as bucket B
  4. Try stacking buckets A and B
  5. You cannot

Expected behavior

Buckets stacked

sirStroam commented 3 years ago

buckets aren't supposed to stack.

copygirl commented 3 years ago

Do newly crafted buckets stack? Maybe that should be fixed then.

Craluminum2413 commented 3 years ago

If they are not supposed to stack, then why they are stacking? image

Craluminum2413 commented 3 years ago

It looks like they do not stack even without the intervention of liquids

https://user-images.githubusercontent.com/69315569/124106853-5064b600-da6d-11eb-9d30-7c4f75ce1df3.mp4

copygirl commented 3 years ago

Alright, since @sirStroam said they aren't supposed to stack, I'm reopening this issue.

sirStroam commented 3 years ago

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.

Craluminum2413 commented 3 years ago

In your opinion, even completely empty buckets shouldn't be supposed to stack?

sirStroam commented 3 years ago

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.

Craluminum2413 commented 3 years ago

But I just checked, that if maxstacksize is missing, it set by default to 64

Craluminum2413 commented 3 years ago

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

Craluminum2413 commented 3 years ago

https://www.vintagestory.at/forums/topic/5166-empty-bucket-that-had-cottage-cheese-in-it-is-somehow-not-empty-1152/?tab=comments#comment-23895

Ragolution commented 3 years ago

Was able to reproduce in 1.15.3

Craluminum2413 commented 2 years ago

Fixed in 1.16.0-pre.9

copygirl commented 2 years ago

The issue is back in 1.16.0-rc.7, as reported in #1546 by @jollki.

Craluminum2413 commented 2 years ago

Well, it never was fixed, I just confused it with maxStackSize (because bucket with maxStackSize as 1 completely fixes that issue)

svanheulen commented 2 years ago

Here's a bucket of milk that was emptied onto the ground with ctrl-right-click: empty Here's that same bucket after it was placed on the ground and then picked up again: empty-placed 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.

svanheulen commented 2 years ago

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.

Craluminum2413 commented 2 years ago

Because bowls and jugs are not the same as buckets

svanheulen commented 2 years ago

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.

Craluminum2413 commented 2 years ago

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.

svanheulen commented 2 years ago

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?

Malnaur2 commented 10 months ago

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.