Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
MicrocontrollersDev committed Aug 24, 2024
1 parent 3a5f7c1 commit fe59894
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import net.fabricmc.api.ModInitializer;

public class OverlayTweaks implements ModInitializer {
@Override
public void onInitialize() {
OverlayTweaksConfig.CONFIG.load();
}
@Override
public void onInitialize() {
OverlayTweaksConfig.CONFIG.load();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class OverlayTweaksConfig {
@SerialEntry public double fireOverlayHeight = 0.0;
@SerialEntry public float customFireOverlayOpacity = 100F;
@SerialEntry public boolean removeItemTooltip = false;
//#if MC <= 1.20.1
//#if MC == 1.20.1
//$$ @SerialEntry public boolean hideScoreboardInDebug = false;
//#endif
@SerialEntry public boolean classicDebugStyle = false;
Expand Down Expand Up @@ -198,7 +198,7 @@ public static Screen configScreen(Screen parent) {
.binding(defaults.removeItemTooltip, () -> config.removeItemTooltip, newVal -> config.removeItemTooltip = newVal)
.controller(TickBoxControllerBuilder::create)
.build())
//#if MC <= 1.20.1
//#if MC == 1.20.1
//$$ .option(Option.<Boolean>createBuilder()
//$$ .name(Text.translatable("overlay-tweaks.hide-scoreboard-in-debug-hud"))
//$$ .description(OptionDescription.of(Text.translatable("overlay-tweaks.hide-scoreboard-in-debug-hud.description")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import dev.microcontrollers.overlaytweaks.config.OverlayTweaksConfig;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.model.ModelPart;
//#if MC < 1.21
//#if MC <= 1.20.6
//$$ import net.minecraft.client.network.ClientPlayerEntity;
//#endif
import net.minecraft.client.render.RenderLayer;
Expand All @@ -24,11 +24,11 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
//#if MC < 1.21
//#if MC <= 1.20.6
//$$ import org.spongepowered.asm.mixin.injection.ModifyArgs;
//#endif
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
//#if MC < 1.21
//#if MC <= 1.20.6
//$$ import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
//#endif

Expand All @@ -55,7 +55,7 @@ private void cancelShieldRendering(ItemStack stack, ModelTransformationMode mode
}

// We need to get the parent method parameters for mode, so we need to use @ModifyArgs.
//#if MC < 1.21
//#if MC <= 1.20.6
//$$ @ModifyArgs(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/model/ModelPart;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V"))
//$$ private void changeShieldColorAndTransparency(Args args, ItemStack stack, ModelTransformationMode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
//$$ if (MinecraftClient.getInstance().player == null) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.mojang.blaze3d.systems.RenderSystem;
import dev.microcontrollers.overlaytweaks.config.OverlayTweaksConfig;
//#if MC <= 1.20.1
//#if MC == 1.20.1
//$$ import net.minecraft.client.MinecraftClient;
//#endif
import net.minecraft.client.gui.DrawContext;
Expand Down Expand Up @@ -53,7 +53,7 @@ private float changeFreezingOpacity(float opacity) {
return opacity * OverlayTweaksConfig.CONFIG.instance().freezingOpacity / 100F;
}

@Inject(method = "renderSpyglassOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawTexture(Lnet/minecraft/util/Identifier;IIIFFIIII)V", shift = At.Shift.BEFORE))
@Inject(method = "renderSpyglassOverlay", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawTexture(Lnet/minecraft/util/Identifier;IIIFFIIII)V"))
private void changeSpyglassOpacityPre(DrawContext context, float scale, CallbackInfo ci) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, OverlayTweaksConfig.CONFIG.instance().spyglassOpacity / 100F);
}
Expand All @@ -72,7 +72,7 @@ private void removeItemTooltip(DrawContext context, CallbackInfo ci) {
if (OverlayTweaksConfig.CONFIG.instance().removeItemTooltip) ci.cancel();
}

//#if MC <= 1.20.1
//#if MC == 1.20.1
//$$ @Inject(method = "renderScoreboardSidebar(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/scoreboard/ScoreboardObjective;)V", at = @At("HEAD"), cancellable = true)
//$$ private void removeScoreboardInDebug(CallbackInfo ci) {
//$$ if (OverlayTweaksConfig.CONFIG.instance().hideScoreboardInDebug && MinecraftClient.getInstance().options.debugEnabled) {
Expand Down

0 comments on commit fe59894

Please sign in to comment.