mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-15 01:34:48 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d1fabfca9 | ||
|
|
555b2b7dd2 |
No files matched your search
@@ -1,4 +1,4 @@
|
||||
# Description or your *PR* and other info
|
||||
# Description of your *PR* and other info
|
||||
<!-- Please include a summary of the change -->
|
||||
<!-- Any details that you think are important to review this PR? -->
|
||||
<!-- Are there any Issues / PRs related to this one? -->
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.gtnewhorizons.angelica.api;
|
||||
|
||||
public interface ExtCeleritasRenderBlocks {
|
||||
|
||||
boolean angelica$shouldApplyCeleritasAO();
|
||||
|
||||
void angelica$setApplyingCeleritasAO(boolean val);
|
||||
|
||||
}
|
||||
+14
-3
@@ -1,5 +1,6 @@
|
||||
package com.gtnewhorizons.angelica.mixins.early.rendering;
|
||||
|
||||
import com.gtnewhorizons.angelica.api.ExtCeleritasRenderBlocks;
|
||||
import com.gtnewhorizons.angelica.common.BlockError;
|
||||
import com.gtnewhorizons.angelica.loading.AngelicaClientTweaker;
|
||||
import com.gtnewhorizons.angelica.proxy.ClientProxy;
|
||||
@@ -33,7 +34,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(RenderBlocks.class)
|
||||
public abstract class MixinRenderBlocks {
|
||||
public abstract class MixinRenderBlocks implements ExtCeleritasRenderBlocks {
|
||||
@Shadow
|
||||
public abstract boolean renderStandardBlockWithColorMultiplier(Block p_147736_1_, int p_147736_2_, int p_147736_3_, int p_147736_4_, float p_147736_5_, float p_147736_6_, float p_147736_7_);
|
||||
|
||||
@@ -109,8 +110,7 @@ public abstract class MixinRenderBlocks {
|
||||
*/
|
||||
@Inject(method = { "renderStandardBlockWithAmbientOcclusion", "renderStandardBlockWithAmbientOcclusionPartial" }, at = @At("HEAD"), cancellable = true)
|
||||
private void handleCeleritasAo(Block block, int x, int y, int z, float r, float g, float b, CallbackInfoReturnable<Boolean> cir) {
|
||||
if ((this.isRenderingByType && Minecraft.isAmbientOcclusionEnabled() && ClientProxy.options().quality.useCeleritasSmoothLighting) ||
|
||||
(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo())) {
|
||||
if (angelica$shouldApplyCeleritasAO()) {
|
||||
this.applyingCeleritasAO = true;
|
||||
try {
|
||||
cir.setReturnValue(this.renderStandardBlockWithColorMultiplier(block, x, y, z, r, g, b));
|
||||
@@ -120,6 +120,17 @@ public abstract class MixinRenderBlocks {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean angelica$shouldApplyCeleritasAO() {
|
||||
return (this.isRenderingByType && Minecraft.isAmbientOcclusionEnabled() && ClientProxy.options().quality.useCeleritasSmoothLighting) ||
|
||||
(Iris.enabled && BlockRenderingSettings.INSTANCE.shouldUseSeparateAo());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void angelica$setApplyingCeleritasAO(boolean val) {
|
||||
this.applyingCeleritasAO = val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Widen the grass identity check ({@code block != Blocks.grass}) to cover any BlockGrass subclass
|
||||
* (e.g. BOP's loamy/sandy/silty grass). When the block being rendered IS a BlockGrass, we return
|
||||
|
||||
Reference in new issue
Block a user