Ladysnake / Effective

A Minecraft Quilt client-side mod adding ambient and environmental interaction effects to enhance immersion.
Other
204 stars 67 forks source link

Rain Ripples on Undergound Water #117

Closed SurealSulwyn closed 1 year ago

SurealSulwyn commented 2 years ago

Installation:

Expected Behaviour:

Actual Behaviour:

lonefelidae16 commented 2 years ago

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.

https://github.com/Ladysnake/Effective/blob/9016afe9a9126a5052e1431405a74f91aecc2ead/src/main/java/ladysnake/effective/mixin/WaterFluidMixin.java#L36-L43

doctor4t commented 1 year ago

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

doctor4t commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Oh, i tried has rain on the POS itself, not pos.up, my bad. Alright I'll try it out again!

Le ven. 18 nov. 2022, 12:31, lonefelidae16 @.***> a écrit :

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.

[image: 2022-11-18_20 13 51] https://user-images.githubusercontent.com/74746227/202694231-276bacca-b66e-45f0-8ba1-a79780b70654.png

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.

— Reply to this email directly, view it on GitHub https://github.com/Ladysnake/Effective/issues/117#issuecomment-1319880838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCL7DMAGIHYBODDEOG4B73WI5SJ3ANCNFSM6AAAAAAQM4P4IU . You are receiving this because you commented.Message ID: @.***>

Arathain commented 1 year ago

Fixed on latest release.