Skip to content

Commit

Permalink
Fix: shwords causing blank messages in chat (#3110)
Browse files Browse the repository at this point in the history
  • Loading branch information
NopoTheGamer authored Dec 25, 2024
1 parent a58bd09 commit 52c078a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ object ModifyVisualWords {
}
}

// Disabled, as it's only a novelty for 30 seconds and will annoy after that everyone.
/*
if (LorenzUtils.isAprilFoolsDay && !FontRendererHook.cameFromChat && Random.nextDouble() < 0.02) {
modifiedText = modifiedText.replace(reverseRegex) {
it.groupValues[1] + it.groupValues[2].reversed()
}
}
*/
modifiedText
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package at.hannibal2.skyhanni.mixins.transformers.gui;

import at.hannibal2.skyhanni.features.misc.visualwords.ModifyVisualWords;
import net.minecraft.client.gui.GuiUtilRenderComponents;
import net.minecraft.util.IChatComponent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(GuiUtilRenderComponents.class)
public class MixinGuiUtilRenderComponents {

@Redirect(method = "splitText", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/IChatComponent;getUnformattedTextForChat()Ljava/lang/String;"))
private static String onSplitText(IChatComponent instance) {
return ModifyVisualWords.INSTANCE.modifyText(instance.getUnformattedTextForChat());
}
}

0 comments on commit 52c078a

Please sign in to comment.