Fish buckets save and restore object properties in item entity #3013

Merged
Ghost merged 16 commits from fish_bucket_save into master 2022-11-27 04:10:13 +01:00
Contributor

This refactors / rewrites the fish bucket code to not use the bucket api at all – it was clearly not made for this kind of thing. It also puts it in a separate file in mcl_buckets.

If the properties metadata field is set on the bucket item, the placing will set the object properties from that after spawn.

Correspondingly axolotls and tropical fish set this meta field on_rightclick bucket pickup.

This way the textures and other properties (mesh is also important for t-fish) are persistent over bucket transfers.

This PR fixes #3008
This PR fixes #3006

This refactors / rewrites the fish bucket code to not use the bucket api at all – it was clearly not made for this kind of thing. It also puts it in a separate file in mcl_buckets. If the properties metadata field is set on the bucket item, the placing will set the object properties from that after spawn. Correspondingly axolotls and tropical fish set this meta field on_rightclick bucket pickup. This way the textures and other properties (mesh is also important for t-fish) are persistent over bucket transfers. This PR fixes #3008 This PR fixes #3006
First-time contributor

Should it check for flowing river water too?

Should it check for flowing river water too?
Author
Contributor

should it check for flowing normal water ? It would only even make a difference when theres flowing river water and ground directly beneath it which i dont think really occurs naturally.

should it check for flowing normal water ? It would only even make a difference when theres flowing river water and ground directly beneath it which i dont think really occurs naturally.
Member

What about when players make an aquarium, to put the aquatics in? That could be river water... depending on mapgen.

What about when players make an aquarium, to put the aquatics in? That could be river water... depending on mapgen.
Author
Contributor

so when they release a fish from a bucket and there is only flowing river water it would place a normal water source .. sounds ok to me - it seems unlikely anyone would make a river water aquarium in the first place if only for the sheer work that means bc river water isn't renewable.

so when they release a fish from a bucket and there is only flowing river water it would place a normal water source .. sounds ok to me - it seems unlikely anyone would make a river water aquarium in the first place if only for the sheer work that means bc river water isn't renewable.
Member

I was thinking the valley mapgen players. riverwater would be common. but replacing the river water with regular water would be okay imho.

I was thinking the valley mapgen players. riverwater would be common. but replacing the river water with regular water would be okay imho.
Author
Contributor

it would still be a huge pain to get all that river water for your aquarium as you'd have to manually transport every single source. It does not replicate like normal water does.

it would still be a huge pain to get all that river water for your aquarium as you'd have to manually transport every single source. It does not replicate like normal water does.
Member

I see your point, even though my brain immediately retorted "oh, kinda like going down and mining 800 deepslate to build a castle..." lol.

The amount of buckets needed to do that would probably make it too much work for most players, so I see what you say. And they would probably exhaust any nearby water sources.

I see your point, even though my brain immediately retorted "oh, kinda like going down and mining 800 deepslate to build a castle..." lol. The amount of buckets needed to do that would probably make it too much work for most players, so I see what you say. And they would probably exhaust any nearby water sources.
Author
Contributor

I've made it so you can place it in flowing river water. But not take from it to prevent unintended water dupe.

I've made it so you can place it in flowing river water. But not take from it to prevent unintended water dupe.
First-time contributor

Seems the meta data is saved to the empty buckets and they no longer stack, and the unlimited water placement in creative is broken again.

Seems the meta data is saved to the empty buckets and they no longer stack, and the unlimited water placement in creative is broken again.
Author
Contributor

fixed

fixed
cora requested review from Ghost 2022-11-26 19:11:37 +01:00
cora force-pushed fish_bucket_save from c3e2c309e4 to f14bfdc0cd 2022-11-26 22:18:56 +01:00 Compare
cora added 1 commit 2022-11-27 00:17:58 +01:00
First-time contributor

Fish buckets cant be placed in item frames, but otherwise works very nicely.

Fish buckets cant be placed in item frames, but otherwise works very nicely.
Member

Fish buckets cant be placed in item frames, but otherwise works very nicely.

The basic buckets, or ones with fish in them?

> Fish buckets cant be placed in item frames, but otherwise works very nicely. The basic buckets, or ones with fish in them?
cora added 1 commit 2022-11-27 04:02:55 +01:00
Ghost approved these changes 2022-11-27 04:09:45 +01:00
Ghost left a comment
First-time contributor

Works, LGTM

Works, LGTM
Ghost merged commit 8b7b2f02e9 into master 2022-11-27 04:10:13 +01:00
Ghost deleted branch fish_bucket_save 2022-11-27 04:10:27 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#3013
No description provided.