-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2dace70
commit e4e6578
Showing
6 changed files
with
181 additions
and
113 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
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
26 changes: 26 additions & 0 deletions
26
src/mixin/java/com/gtnewhorizons/angelica/mixins/early/shaders/MixinItemRenderer.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,26 @@ | ||
package com.gtnewhorizons.angelica.mixins.early.shaders; | ||
|
||
import com.gtnewhorizons.angelica.compat.mojang.InteractionHand; | ||
import net.coderbot.iris.pipeline.HandRenderer; | ||
import net.irisshaders.iris.api.v0.IrisApi; | ||
import net.minecraft.client.renderer.ItemRenderer; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(ItemRenderer.class) | ||
public class MixinItemRenderer { | ||
@Inject(method = "renderItemInFirstPerson", at = @At("HEAD"), cancellable = true) | ||
private void iris$skipTranslucentHands(float partialTicks, CallbackInfo ci) { | ||
if (IrisApi.getInstance().isShaderPackInUse()) { | ||
// TODO: Offhand | ||
boolean isHandTranslucent = HandRenderer.INSTANCE.isHandTranslucent(InteractionHand.MAIN_HAND); | ||
if (HandRenderer.INSTANCE.isRenderingSolid() && isHandTranslucent) { | ||
ci.cancel(); | ||
} else if (!HandRenderer.INSTANCE.isRenderingSolid() && !isHandTranslucent) { | ||
ci.cancel(); | ||
} | ||
} | ||
} | ||
} |
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