-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.21.2
- Loading branch information
Showing
44 changed files
with
492 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
plugins { | ||
// see https://fabricmc.net/develop/ for new versions | ||
id 'fabric-loom' version '1.7-SNAPSHOT' apply false | ||
id 'fabric-loom' version '1.8-SNAPSHOT' apply false | ||
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions | ||
id 'net.neoforged.moddev' version '1.0.19' apply false | ||
id 'net.neoforged.moddev' version '2.0.40-beta' apply false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
common/src/main/java/ca/fxco/moreculling/mixin/CloudRenderer_cloudsMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
package ca.fxco.moreculling.mixin; | ||
|
||
import ca.fxco.moreculling.MoreCulling; | ||
import com.mojang.blaze3d.systems.RenderSystem; | ||
import com.mojang.blaze3d.vertex.BufferBuilder; | ||
import me.fallenbreath.conditionalmixin.api.annotation.Condition; | ||
import me.fallenbreath.conditionalmixin.api.annotation.Restriction; | ||
import net.minecraft.client.renderer.CloudRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Restriction(conflict = { | ||
@Condition("cullclouds"), | ||
@Condition("extended-clouds"), | ||
@Condition("extendedclouds") | ||
}) | ||
@Mixin(CloudRenderer.class) | ||
public abstract class CloudRenderer_cloudsMixin { | ||
@Shadow | ||
private static boolean isNorthEmpty(long l) { | ||
return false; | ||
} | ||
|
||
@Shadow | ||
private static boolean isSouthEmpty(long l) { | ||
return false; | ||
} | ||
|
||
@Shadow | ||
private static boolean isWestEmpty(long l) { | ||
return false; | ||
} | ||
|
||
@Shadow | ||
private static boolean isEastEmpty(long l) { | ||
return false; | ||
} | ||
|
||
@Inject( | ||
method = "buildExtrudedCell", | ||
at = @At(value = "HEAD"), | ||
cancellable = true | ||
) | ||
private void moreculling$renderClouds(CloudRenderer.RelativeCameraPos relativeCameraPos, | ||
BufferBuilder bufferBuilder, int i, int j, int k, | ||
int l, int m, int n, long o, CallbackInfo ci) { | ||
if (!MoreCulling.CONFIG.cloudCulling) { | ||
return; | ||
} | ||
RenderSystem.enableCull(); | ||
float f = (float)m * 12.0F; | ||
float g = f + 12.0F; | ||
float h = 0.0F; | ||
float p = 4.0F; | ||
float q = (float)n * 12.0F; | ||
float r = q + 12.0F; | ||
if (relativeCameraPos != CloudRenderer.RelativeCameraPos.BELOW_CLOUDS) { | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(j); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(j); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(j); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(j); | ||
} | ||
|
||
if (relativeCameraPos != CloudRenderer.RelativeCameraPos.ABOVE_CLOUDS) { | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(i); | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(i); | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(i); | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(i); | ||
} | ||
|
||
if (isNorthEmpty(o) && n > 0) { | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(l); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(l); | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(l); | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(l); | ||
} | ||
|
||
if (isSouthEmpty(o) && n < 0) { | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(l); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(l); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(l); | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(l); | ||
} | ||
|
||
if (isWestEmpty(o) && m > 0) { | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(k); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(k); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(k); | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(k); | ||
} | ||
|
||
if (isEastEmpty(o) && m < 0) { | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(k); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(k); | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(k); | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(k); | ||
} | ||
|
||
boolean bl = Math.abs(m) <= 1 && Math.abs(n) <= 1; | ||
if (bl) { | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(j); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(j); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(j); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(j); | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(i); | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(i); | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(i); | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(i); | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(l); | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(l); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(l); | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(l); | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(l); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(l); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(l); | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(l); | ||
bufferBuilder.addVertex(f, 0.0F, q).setColor(k); | ||
bufferBuilder.addVertex(f, 4.0F, q).setColor(k); | ||
bufferBuilder.addVertex(f, 4.0F, r).setColor(k); | ||
bufferBuilder.addVertex(f, 0.0F, r).setColor(k); | ||
bufferBuilder.addVertex(g, 0.0F, r).setColor(k); | ||
bufferBuilder.addVertex(g, 4.0F, r).setColor(k); | ||
bufferBuilder.addVertex(g, 4.0F, q).setColor(k); | ||
bufferBuilder.addVertex(g, 0.0F, q).setColor(k); | ||
} | ||
ci.cancel(); | ||
} | ||
} |
125 changes: 0 additions & 125 deletions
125
common/src/main/java/ca/fxco/moreculling/mixin/LevelRenderer_cloudsMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.