-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from jchung01/vanilla-tweaks
Render block overlay fix based on state
- Loading branch information
Showing
4 changed files
with
53 additions
and
7 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
34 changes: 34 additions & 0 deletions
34
...od/acgaming/universaltweaks/bugfixes/blocks/blockoverlay/mixin/UTEntityRendererMixin.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,34 @@ | ||
package mod.acgaming.universaltweaks.bugfixes.blocks.blockoverlay.mixin; | ||
|
||
import net.minecraft.client.renderer.EntityRenderer; | ||
import net.minecraft.client.renderer.RenderGlobal; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.BlockRenderLayer; | ||
|
||
import com.llamalad7.mixinextras.injector.wrapoperation.Operation; | ||
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; | ||
import mod.acgaming.universaltweaks.bugfixes.blocks.blockoverlay.UTBlockOverlay; | ||
import mod.acgaming.universaltweaks.config.UTConfigBugfixes; | ||
import org.objectweb.asm.Opcodes; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Slice; | ||
|
||
// Courtesy of jchung01 | ||
@Mixin(value = EntityRenderer.class) | ||
public class UTEntityRendererMixin | ||
{ | ||
@WrapOperation(method = "renderWorldPass", | ||
slice = @Slice(from = @At(value = "FIELD", target = "Lnet/minecraft/util/BlockRenderLayer;SOLID:Lnet/minecraft/util/BlockRenderLayer;", opcode = Opcodes.GETSTATIC), | ||
to = @At(value = "FIELD", target = "Lnet/minecraft/util/BlockRenderLayer;CUTOUT_MIPPED:Lnet/minecraft/util/BlockRenderLayer;", opcode = Opcodes.GETSTATIC)), | ||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderGlobal;renderBlockLayer(Lnet/minecraft/util/BlockRenderLayer;DILnet/minecraft/entity/Entity;)I")) | ||
private int utSetBlockOverlayState(RenderGlobal instance, BlockRenderLayer layer, double partialTicks, int pass, Entity entity, Operation<Integer> original) | ||
{ | ||
if (!UTConfigBugfixes.BLOCKS.BLOCK_OVERLAY.utBlockOverlayToggle) return original.call(instance, layer, partialTicks, pass, entity); | ||
int ret; | ||
UTBlockOverlay.setRender(true); | ||
ret = original.call(instance, layer, partialTicks, pass, entity); | ||
UTBlockOverlay.setRender(false); | ||
return ret; | ||
} | ||
} |
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