Skip to content

Commit

Permalink
Support for Forge custom cloud rendering
Browse files Browse the repository at this point in the history
Fixes #531
Also should be applied on 1.20.x branches
  • Loading branch information
Asek3 committed Sep 22, 2023
1 parent 1e2069e commit 63536f8
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ public class MixinWorldRenderer {
*/
@Overwrite
public void renderClouds(MatrixStack matrices, Matrix4f projectionMatrix, float tickDelta, double x, double y, double z) {
if (this.cloudRenderer == null) {
this.cloudRenderer = new CloudRenderer(client.getResourceManager());
}
if (!this.world.getDimensionEffects().renderClouds(this.world, this.ticks, tickDelta, matrices, x, y, z, projectionMatrix)) {
if (this.cloudRenderer == null) {
this.cloudRenderer = new CloudRenderer(client.getResourceManager());
}

this.cloudRenderer.render(this.world, this.client.player, matrices, projectionMatrix, this.ticks, tickDelta, x, y, z);
this.cloudRenderer.render(this.world, this.client.player, matrices, projectionMatrix, this.ticks, tickDelta, x, y, z);
}
}

@Inject(method = "reload(Lnet/minecraft/resource/ResourceManager;)V", at = @At("RETURN"))
Expand Down

0 comments on commit 63536f8

Please sign in to comment.