Effective

Effective

5M Downloads

Rain Ripples on Undergound Water

SurealSulwyn opened this issue · 6 comments

commented

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
commented

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;
}

commented

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

commented

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

commented
commented

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.

commented

Fixed on latest release.