Skip to content

Commit

Permalink
Fix extra utilities item rendered with healing axe and other items in…
Browse files Browse the repository at this point in the history
… third person (#161)

* fix rendering issue when holding healing axe in 3rd person
  • Loading branch information
Alexdoru authored Jan 17, 2023
1 parent 924f99a commit 8800b01
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/mitchej123/hodgepodge/LoadingConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class LoadingConfig {
public boolean fixDimensionChangeHearts;
public boolean fixEatingStackedStew;
public boolean fixEnchantmentNumerals;
public boolean fixExtraUtilitiesItemRendering;
public boolean fixExtraUtilitiesUnEnchanting;
public boolean fixFenceConnections;
public boolean fixFireSpread;
Expand Down Expand Up @@ -171,6 +172,7 @@ public LoadingConfig(File file) {
fixDimensionChangeHearts = config.get(Category.FIXES.toString(), "fixDimensionChangeHearts", true, "Fix losing bonus hearts on dimension change").getBoolean();
fixEatingStackedStew = config.get(Category.FIXES.toString(), "fixEatingStackedStew", true, "Fix deleting stack when eating mushroom stew").getBoolean();
fixEnchantmentNumerals = config.get(Category.FIXES.toString(), "fixEnchantmentNumerals", true, "Fix enchantment levels not displaying properly above a certain value").getBoolean();
fixExtraUtilitiesItemRendering = config.get(Category.FIXES.toString(), "fixExtraUtilitiesItemRendering", true, "Fixes rendering issues with transparent items from extra utilities").getBoolean();
fixExtraUtilitiesUnEnchanting = config.get(Category.FIXES.toString(), "fixExtraUtilitiesUnEnchanting", true, "Fix dupe bug with division sigil removing enchantment").getBoolean();
fixFenceConnections = config.get(Category.FIXES.toString(), "fixFenceConnections", true, "Fix fence connections with other types of fence").getBoolean();
fixFireSpread = config.get(Category.FIXES.toString(), "fixFireSpread", true, "Fix vanilla fire spread sometimes cause NPE on thermos").getBoolean();
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ public enum Mixins {
.setSide(Side.BOTH)
.setApplyIf(() -> Common.config.disableAidSpawnByXUSpikes)
.addTargetedMod(TargetedMod.EXTRA_UTILITIES)),
FIX_EXTRA_UTILITIES_TRANSPARENT_ITEM_RENDER(new Builder("Fix extra utilities item rendering for transparent items")
.addMixinClasses("extrautilities.MixinTransparentItemRender")
.setSide(Side.CLIENT)
.setApplyIf(() -> Common.config.fixExtraUtilitiesItemRendering)
.addTargetedMod(TargetedMod.EXTRA_UTILITIES)),

// Various Exploits/Fixes
GC_TIME_COMMAND_FIX(new Builder("GC Time Fix")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.mitchej123.hodgepodge.mixins.late.extrautilities;

import com.rwtema.extrautils.item.RenderItemMultiTransparency;
import com.rwtema.extrautils.item.RenderItemUnstable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;

@Mixin({RenderItemMultiTransparency.class, RenderItemUnstable.class})
public class MixinTransparentItemRender {

@Redirect(
method = "renderItem",
remap = false,
slice =
@Slice(
from = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glBlendFunc(II)V"),
to = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glShadeModel(I)V")),
at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glDisable(I)V"))
private void hodgepodge$fixItemRender(int cap) {
// do nothing to cancel call
}
}

0 comments on commit 8800b01

Please sign in to comment.