Skip to content

Conversation

@kirjorjos
Copy link

Add the ability for fluid tanks and buckets to work in a feeding slab for bees that need a fluid to pollinate

} 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());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about fluids that don't have blocks?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

return true;
}
IFluidHandler flowerFluid = flowerItem.getCapability(Capabilities.FluidHandler.ITEM);
if (flowerFluid != null && flowerFluid.getFluidInTank(0).getAmount() >= ProductiveBeesConfig.BEES.minimumMbForFlowering.get()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's only a check for the amount here, what about the fluid type?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants