-
-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix water bottle filling not working in the end dimension #4327
Fix water bottle filling not working in the end dimension #4327
Conversation
BlockHitResult hitResult = getPlayerPOVHitResult(world, player, ClipContext.Fluid.SOURCE_ONLY); | ||
if (hitResult.getType() == HitResult.Type.BLOCK) { | ||
BlockPos pos = hitResult.getBlockPos(); | ||
return world.mayInteract(player, pos) && !world.getFluidState(pos).is(FluidTags.WATER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this mayInteract here? Pretty sure mc internals already do this check before calling any item specific stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The BottleItem
also does a mayInteract
check first. I believe the "global" mayInteract
check applies to the player's location, while this one here applies to the block the bottle is potentially being used on.
The situation this covers is as follows: The player stands in an unprotected area, but aims at a water block in a protected area. The question is, should that mean the player can't use the bottle at all (without the mayInteract
call) or should it fall back to picking up air from the end (with the call).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, is this meant to only check for water or absence of any fluid? the logic doesn't match the method name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was supposed to be water (covering the vanilla glass bottle logic), but the bug report mentioned fluids in general. Which way do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it to check for absolutely any fluids (even flowing ones) for maximum compatibility. You need to use the bottle in the air or against some block now.
Just wondering, that Discord discussion about potentially using empty managlass vials or even alfglass flasks (or either?) for bottling ender air instead of using regular empty bottles – is that something you folks would want something prototyped for? |
cf8244f
to
09bc3f5
Compare
09bc3f5
to
181d69c
Compare
While in the End, don't attempt to pick up ender air while looking at fluids. This more generic approach will disallow ender air bottling while looking at lava, even if attempting to use a bottle this way wouldn't do anything by default, but it's less likely to cause issues with other mods that attempt to bottle fluids from the world.
181d69c
to
84fddef
Compare
Fix for #4273. Botania's logic for creating ender air bottles is skipped if the player aims at water.
(Grabbing fluids from blocks, e.g. getting honey bottles from full bee nests, was not affected.)