Globox1997 / Dehydration

https://modrinth.com/mod/dehydration
https://www.curseforge.com/minecraft/mc-mods/dehydration
GNU General Public License v3.0
16 stars 21 forks source link

[1.21] Incompatibility with BucketLib #168

Open cech12 opened 6 days ago

cech12 commented 6 days ago

Make sure you are not opening a duplicate.

Description of your suggestion.

Hello,

I am the developer of the BucketLib mod and the related Wooden & Ceramic Bucket mods. An user opened the following issue: https://github.com/cech12/WoodenBucket/issues/20

The issue is, when right-clicking with a Wooden Bucket (1.21-4.0.0.0) (BucketLib 1.21-4.0.0.3) on the Purified Water Block, the Purified Water Block disappears.

After some research I found the compatibility problem. My BucketLib mod is interacting with the fluid block here: https://github.com/cech12/BucketLib/blob/1.21/fabric/src/main/java/de/cech12/bucketlib/platform/FabricFluidHelper.java#L161 It uses the BucketPickup::pickupBlock method to get the filled "vanilla" bucket. The returned BucketItem is used to get the fluid and create a filled modded bucket. The issue is, that your PurifiedBucket is not an instance of the vanilla BucketItem. https://github.com/Globox1997/Dehydration/blob/1.21/src/main/java/net/dehydration/item/PurifiedBucket.java#L32 So, for my library mod, there is no possibility to get the fluid out of the item. My only fix could be, that the fluid should not disappear when right-clicking it with a modded bucket.

I would recommend to use or extend the vanilla BucketItem class to fix our compatibility issue. :) More information: https://github.com/cech12/BucketLib/wiki/Developer-Guide#make-your-mod-compatible

If you need help, please let me know. :)

ColinBashful commented 6 days ago

I'm gonna add the compatibility, fix some Bugs. Then I'll make a Pull Request. Welp, CEST Time, so I'll do it when I wake up

ColinBashful commented 6 days ago

I've made a pull request, and now it just needs to get accepted.

cech12 commented 6 days ago

I like that :) I left a comment in the PR. Maybe using the FluidStorage system would be a better way to support BucketLib and multiple other mods as well :)