Bucket with water can stack sometimes #745
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#745
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Usually when you stack several empty buckets and start filling them with water - they change their positions and place in the inventory without being stacked and you can't force them to stack - so I considered it was a correct behavior...
But sometimes when I play and empty some bucket and some refill again several times I find stacked several of them. But I'm still can't stack more then it is...
I captured a video just to confirm what I saw. As for me it's not a big problem for playing but looks like an error.
https://youtu.be/ZG2U1zXzeN8
No idea if it's related to Wuzzy/MineClone2#727
Regards,
First of all: Water buckets are supposed to be stackable.
Sadly, I can't reproduce this. I can stack all buckets just fine. Strange.
I remember this bug, although I think I was in the Minetest Game at the time, which is why I didn't report it here. On the other hand, I never played with several buckets of water at a time in MineClone 2, but I'll try this. :)
Ok, I found a way to replicate the stacking bug. :)
Here's what happens: https://youtu.be/8yiB2Wqhwgo
It's here, https://git.minetest.land/Wuzzy/MineClone2/src/branch/master/mods/ITEMS/mcl_buckets/init.lua#L250 :
new_bucket with liquid just returns if it is alone, but if not and the mode is not creative - new_bucket adds but not takes and it's a question for me for the moment it adds to the stack or not, cause i'm still a newbie :)
But in the similar minetest mod this case is handled more carefully... IDK where "official" bucket mod's source published now, so it's the code from Windows version 5.3.0-dev:
@Wuzzy Would you mind telling me how strictly you suppose to follow https://minecraft.gamepedia.com/Water_Bucket ?
Water bucket is not stackable there in the article. Empty bucket has stack size 16 like in MCL2. Whether we like it or not, there are also some physical principles of that...
Physical principles? :)) An empty bucket has the same physical size as a full bucket. And stacking solid blocks up to 64 is far from reality, just as unreal it is stacking 64 chests inside a single chest slot. :)) Or getting apples from oak trees. :))
We should just settle on some game rules and make sure they are reliably implemented. The current implementation of the water bucket is buggy.
You right about the size, and about the logic which can absent at all, but I meant the difference of empty bucket which allows to stack it the way like on the picture:
I'm trying to fix and have a strange sence that maybe I'm doing wrong thing so I decided to clarify.
I had the same picture in mind when you first mentioned physical principle, but it's still funny because a lot of things are complete nonsense in Minecraft/Minetest/MineClone. :P
So it's ultimately a matter of decision on how it should be implemented. But as with all the stackable items that can hold something in them (buckets, bowls, bottles), normally the filled ones should not stack.
I feel myself so stupid just because of I new to Lua and Minetest and MineClone 2 :(
I don't know some very base things and waste a lot of time because of it...
When I read about the
itemstack
which returns afterplace
action they say it must contain:nil
(if we don't change it)There is no way to replace the stack with some new items, at least how it was documented, but
mcl_bucket
does it: replaces old bucket (unfilled) with filled one and back. So I firstly thought the problem is because of that and rewrote it to comply the rules, but... surprizingly it didn't help at all :)Then I added some debug information, I don't know what's the reason to gather metadata from nodes and store them into the stack so I wanted to see them to start and what I saw is on the first screen.
When I removed this unclear (for me) meta gathering - bucket stacking became to work fine. Image number 2.
Now I may show you the fix but it still contain the first part when I tried to rewrite it to comply its own docs :) Seems now I need to start again from upstream version and try to just remove meta... but now I have no time for that and just want to document what I did.
now #contribution_inside but needs to be cleared... Dispense part is touched with no purpose and many other probably useless things...
7d6a9c6d66
I've reverted all my changes and removed only medadata gathering.
And it all works.
But there's a bevaioural difference from my way of
itemstack
usage: if you have 16 empty buckets and start to fill them all one by one... 16th of them wont stack to precious 15 filled already. You will get it instead of the empty - it transforms right in your hand.Probably it's good......... My repo contains good version now, but I have no readable patch for it, will try to make it later to merge...
By the way, why somebody gathers metadata to itemstack?
The patch for revising and picking it up if okay:
36074e6e3c
@kneekoo @Wuzzy By the way water bottles do not stack, speaking of the logic :(
I know, the water buckets were the exception. As I mentioned earlier, filled items shouldn't stack - buckets, bowls, bottles (are there others?)
Potions should not stack because they give you effects. This basically means you can only carry a small number of potions with you, and you have to organize. This is by design.
I tried to find old version of
bucket
with meta data usage and I found one of the year 2013 by @TenPlus1: https://forum.minetest.net/viewtopic.php?t=7633This code is really rare now. Meta data was used in it to determine
fullness
on placing liquids:This is not used now, even in minetest_game ( https://github.com/minetest/minetest_game/blob/master/mods/bucket/init.lua ).
So I removed the usage of metadata for upstream too,
125840c9e4
It is now fixed.