Skip to content
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

Rain Ripples on Undergound Water #117

Closed
SurealSulwyn opened this issue Sep 15, 2022 · 6 comments
Closed

Rain Ripples on Undergound Water #117

SurealSulwyn opened this issue Sep 15, 2022 · 6 comments

Comments

@SurealSulwyn
Copy link

Installation:

  • Minecraft: v1.19.2
  • Fabric Loader: v0.14.9
  • Effective: v1.3
  • Fabric API: v0.60.0+1.19.2
  • Mod Menu: v4.0.6

Expected Behaviour:

  • Rain ripples appear on source water that has sky access when it is raining

Actual Behaviour:

  • Rain ripples appear on all source water when it is raining, even underground water with no sky access
@lonefelidae16
Copy link
Contributor

Can confirm, it is caused by WaterFluidMixin.shouldRippile.

Using World#hasRain(BlockPos) instead of World#isRaining() && BlockState#isAir() on line 40 would fix this issue.

@Unique
private static boolean shouldRipple(World world, BlockPos pos) {
if (EffectiveConfig.rainRippleDensity > 0) {
FluidState fluidState = world.getFluidState(pos);
return fluidState.isStill() && world.isRaining() && world.getBlockState(pos.add(0, 1, 0)).isAir();
}
return false;
}

@doctor4t
Copy link
Member

doctor4t commented Nov 17, 2022

Thanks for the fix @lonefelidae16, didn't even know that method was a thing! Appreciate it a lot <3

@doctor4t
Copy link
Member

After giving it a try, it seems hasRain doesn't work on the client, as isSkyVisible always returns false on the client for some reason

@lonefelidae16
Copy link
Contributor

Thank you for trying my patch!

After giving it a try, it seems hasRain doesn't work on the client, as isSkyVisible always returns false on the client for some reason

I wonder why. I installed and tried Quilt immediately and it worked fine.

2022-11-18_20 13 51

My WaterFluidMixin.java is:

	@Unique
	private static boolean shouldRipple(World world, BlockPos pos) {
		if (EffectiveConfig.rainRippleDensity > 0) {
			FluidState fluidState = world.getFluidState(pos);
-			return fluidState.isSource() && world.isRaining() && world.getBlockState(pos.add(0, 1, 0)).isAir();
+			return fluidState.isSource() && world.hasRain(pos.up());
		}
		return false;
	}

It is important to note that it must to be specified the position of the Y-axis +1 to work, rather than entering pos directly.

@doctor4t
Copy link
Member

doctor4t commented Nov 18, 2022 via email

@Arathain
Copy link
Collaborator

Arathain commented Jan 5, 2023

Fixed on latest release.

@Arathain Arathain closed this as completed Jan 5, 2023
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 a pull request may close this issue.

4 participants