Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
| Basic | [MC-217716](https://bugs.mojang.com/browse/MC-217716) | The green nausea overlay isn't removed when switching into spectator mode |
| Basic | [MC-231097](https://bugs.mojang.com/browse/MC-231097) | Holding the "Use" button continues to slow down the player even after the used item has been dropped |
| Basic | [MC-237493](https://bugs.mojang.com/browse/MC-237493) | Telemetry cannot be disabled |
| Basic | [MC-268420](https://bugs.mojang.com/browse/MC-268420) | Cooldown indicator flashes when switching items with high attack speed attribute |

### Server Side (Both)
| Type | Bug ID | Name |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.isxander.debugify.client.mixins.basic.mc268420;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.resources.ResourceLocation;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

@BugFix(id = "MC-268420", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, description = "Cooldown indicator flashes when switching items with high attack speed attribute")
@Mixin(Gui.class)
public class GuiMixin {
@Shadow
@Final
private Minecraft minecraft;

// the FULL sprite never shows anyway so no need to wrap it
@WrapWithCondition(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;blitSprite(Lcom/mojang/blaze3d/pipeline/RenderPipeline;Lnet/minecraft/resources/ResourceLocation;IIII)V", ordinal = 2))
private boolean fixAttackIndicatorFlashing(GuiGraphics instance, RenderPipeline renderPipeline, ResourceLocation resourceLocation, int i, int j, int k, int l) {
return this.minecraft.player.getAttackStrengthScale(0.0F) * 17F > 0;
}
}
1 change: 1 addition & 0 deletions src/client/resources/debugify.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"basic.mc237493.TelemetryEventWidgetMixin",
"basic.mc237493.TelemetryInfoScreenMixin",
"basic.mc263865.KeyboardHandlerMixin",
"basic.mc268420.GuiMixin",
"basic.mc4490.FishingHookRendererMixin",
"basic.mc46503.ClientPacketListenerMixin",
"basic.mc46766.MinecraftMixin",
Expand Down