Add support for fluid tanks in feeding slabs#625
Add support for fluid tanks in feeding slabs#625kirjorjos wants to merge 2 commits intoJDKDigital:dev-1.21.0from
Conversation
| } else { | ||
| IFluidHandler stackFluidTank = stack.getCapability(Capabilities.FluidHandler.ITEM); | ||
| if (stackFluidTank != null && stackFluidTank.getFluidInTank(0).getAmount() >= ProductiveBeesConfig.BEES.minimumMbForFlowering.get()) { | ||
| possibleBlocks.add(stackFluidTank.getFluidInTank(0).getFluid().defaultFluidState().createLegacyBlock().getBlock()); |
There was a problem hiding this comment.
what about fluids that don't have blocks?
There was a problem hiding this comment.
Afaik, there's no way for fluids without blocks to be used right now so it would be consistent with the current behavior, but if I'm wrong or you want it to work for fluids without blocks, I would need to modify the call to be TagKey<Item> tag rather than TagKey<Block> tag which I'm fine doing, I was just trying not to change the existing code too much.
There was a problem hiding this comment.
Looking at the code again, I can't seem to find anywhere that non block fluids work at all, but if you can give me an example of how to use a fluid that doesn't have a block before this PR, I can definitely look at how that one is done.
src/main/java/cy/jdkdigital/productivebees/common/entity/bee/ConfigurableBee.java
Outdated
Show resolved
Hide resolved
src/main/java/cy/jdkdigital/productivebees/common/entity/bee/ConfigurableBee.java
Outdated
Show resolved
Hide resolved
| return true; | ||
| } | ||
| IFluidHandler flowerFluid = flowerItem.getCapability(Capabilities.FluidHandler.ITEM); | ||
| if (flowerFluid != null && flowerFluid.getFluidInTank(0).getAmount() >= ProductiveBeesConfig.BEES.minimumMbForFlowering.get()) { |
There was a problem hiding this comment.
there's only a check for the amount here, what about the fluid type?
There was a problem hiding this comment.
I was basing it mainly off the existing flower block system which uses the DEFAULT_FLOWERING_BLOCK tag, if I did it the same way, we would need to make a DEFAULT_FLOWERING_FLUID tag or have a way to grab the flowering fluid from within the ProductiveBee class. I think if you do want to check for the fluid here, adding the tags would be easier, but I'll work on doing it whichever way you want it done.
There was a problem hiding this comment.
I don't want a default flowering fluid, this here looks like it would enable any bee to flower off of a bucket of water.
There was a problem hiding this comment.
I thought that was checked for else where so I did a test. I'm not really sure how to do a proper test for this tbh, but I did 2 in game tests for half an hour each: both with 2 advanced hives and 4 Omega upgrades, 1 with a lava bucket in a feeding slab, 1 with a water bucket in a feeding slab. I put a water bee in both, and for the first test, just let it run, for the second test, I swapped the water bee to pollinate with lava to test it. Test 1, only the water hive filled with anything, test 2, only the lava hive filled with anything.
Add the ability for fluid tanks and buckets to work in a feeding slab for bees that need a fluid to pollinate