Skip to content

Commit

Permalink
new feature disableGuiShadowLayer
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendrix-Shen committed May 18, 2021
1 parent 076cdb0 commit 31fe305
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ public static class Disable {
public static final ConfigBooleanHotkeyed DISABLE_ENTITY_TNT_RENDERING = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableEntityTNTRendering", false, "");
public static final ConfigBooleanHotkeyed DISABLE_ENTITY_WITHER_RENDERING = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableEntityWitherRendering", false, "");
public static final ConfigBooleanHotkeyed DISABLE_ENTITY_ZOMBIE_VILLAGER_RENDERING = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableEntityZombieVillagerRendering", false, "");
public static final ConfigBooleanHotkeyed DISABLE_GUI_SHADOW_LAYER = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableGuiShadowLayer", false, "");
public static final ConfigBooleanHotkeyed DISABLE_RENDER_OVERLAY_FIRE = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableRenderOverlayFire", false, "");
public static final ConfigBooleanHotkeyed DISABLE_RENDER_OVERLAY_PUMPKIN = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableRenderOverlayPumpkin", false, "");
public static final ConfigBooleanHotkeyed DISABLE_SCOREBOARD_RENDERING = new TranslatableConfigBooleanHotkeyed(PREFIX, "disableScoreboardRendering", false, "");
Expand All @@ -202,6 +203,7 @@ public static class Disable {
DISABLE_ENTITY_TNT_RENDERING,
DISABLE_ENTITY_ZOMBIE_VILLAGER_RENDERING,
DISABLE_ENTITY_WITHER_RENDERING,
DISABLE_GUI_SHADOW_LAYER,
DISABLE_RENDER_OVERLAY_FIRE,
DISABLE_RENDER_OVERLAY_PUMPKIN,
DISABLE_SCOREBOARD_RENDERING,
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/top/hendrixshen/TweakMyClient/mixin/MixinScreen.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package top.hendrixshen.TweakMyClient.mixin;

import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.util.math.MatrixStack;
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;
import top.hendrixshen.TweakMyClient.config.Configs;

@Mixin(Screen.class)
public class MixinScreen {
@Inject(
method = "renderBackground(Lnet/minecraft/client/util/math/MatrixStack;I)V",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/gui/screen/Screen;fillGradient(Lnet/minecraft/client/util/math/MatrixStack;IIIIII)V"
),
cancellable = true
)
private void onFillG(MatrixStack matrices, int vOffset, CallbackInfo ci) {
if (Configs.Disable.DISABLE_GUI_SHADOW_LAYER.getBooleanValue()) {
ci.cancel();
}
}
}
4 changes: 3 additions & 1 deletion src/main/resources/assets/tweakmyclient/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"tweakmyclient.config.disable_toggle.disableEntityZombieVillagerRendering.comment": "Disables zombie villager entity rendering.\nMaybe it's useful for fake peace.",
"tweakmyclient.config.disable_toggle.disableRenderOverlayFire.name": "disableRenderOverlayFire",
"tweakmyclient.config.disable_toggle.disableRenderOverlayFire.comment": "Disables fire overlay rendering when player is on fire.\nYou will gain a broader view.",
"tweakmyclient.config.disable_toggle.disableGuiShadowLayer.name": "disableGuiShadowLayer",
"tweakmyclient.config.disable_toggle.disableGuiShadowLayer.comment": "Disables gui shadow overlay rendering when gui is opening.",
"tweakmyclient.config.disable_toggle.disableRenderOverlayPumpkin.name": "disableRenderOverlayPumpkin",
"tweakmyclient.config.disable_toggle.disableRenderOverlayPumpkin.comment": "Disables mask overlay rendering when player is wearing pumpkin.\nYou will gain a broader view.",
"tweakmyclient.config.disable_toggle.disableScoreboardRendering.name": "disableScoreboardRendering",
Expand All @@ -45,7 +47,7 @@
"tweakmyclient.config.disable_toggle.disableSlowdown.comment": "Cancels slowness effects caused by honey, soul sand and using items.",

"tweakmyclient.config.feature_toggle.featureAutoReconnect.name": "featureAutoReconnect",
"tweakmyclient.config.feature_toggle.featureAutoReconnect.comment": "Automatically reconnects when you disconnect from the server.",
"tweakmyclient.config.feature_toggle.featureAutoReconnect.comment": "Automatically reconnects when you disconnect from the server.\nAdaptive authme and reauth session validation.",
"tweakmyclient.config.feature_toggle.featureAutoRespawn.name": "featureAutoRespawn",
"tweakmyclient.config.feature_toggle.featureAutoRespawn.comment": "Automatically respawns you whenever you die.",
"tweakmyclient.config.feature_toggle.featureDaylightOverride.name": "featureDaylightOverride",
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/assets/tweakmyclient/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"tweakmyclient.config.disable_toggle.disableEntityZombieVillagerRendering.comment": "关闭游戏对僵尸村民实体的渲染.\n也许对伪和平有帮助.",
"tweakmyclient.config.disable_toggle.disableRenderOverlayFire.name": "禁用火焰渲染层",
"tweakmyclient.config.disable_toggle.disableRenderOverlayFire.comment": "关闭在玩家着火时的渲染覆盖.\n你将获得更广阔的视野.",
"tweakmyclient.config.disable_toggle.disableGuiShadowLayer.name": "禁用GUI阴影层",
"tweakmyclient.config.disable_toggle.disableGuiShadowLayer.comment": "关闭打开GUI时的阴影层渲染.",
"tweakmyclient.config.disable_toggle.disableRenderOverlayPumpkin.name": "禁用南瓜头渲染层",
"tweakmyclient.config.disable_toggle.disableRenderOverlayPumpkin.comment": "关闭在玩家在穿戴南瓜时的渲染覆盖.\n你将获得更广阔的视野.",
"tweakmyclient.config.disable_toggle.disableScoreboardRendering.name": "禁用计分板渲染",
Expand All @@ -45,7 +47,7 @@
"tweakmyclient.config.disable_toggle.disableSlowdown.comment": "取消蜂蜜块, 灵魂沙和使用物品时的减速效果.",

"tweakmyclient.config.feature_toggle.featureAutoReconnect.name": "自动重连",
"tweakmyclient.config.feature_toggle.featureAutoReconnect.comment": "从服务器断开连接时自动重新连接服务器.",
"tweakmyclient.config.feature_toggle.featureAutoReconnect.comment": "从服务器断开连接时自动重新连接服务器.\n适配 Authme 和 Reauth 会话验证",
"tweakmyclient.config.feature_toggle.featureAutoRespawn.name": "自动重生",
"tweakmyclient.config.feature_toggle.featureAutoRespawn.comment": "死亡时自动重生.",
"tweakmyclient.config.feature_toggle.featureDaylightOverride.name": "覆盖客户端世界时间",
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/mixins.TweakMyClient.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"MixinInGameHud",
"MixinInGameOverlayRenderer",
"MixinMinecraftClient",
"MixinScreen",
"authme.MixinDisconnectedScreen",
"reauth.MixinDisconnectedScreen"
]
Expand Down

0 comments on commit 31fe305

Please sign in to comment.