diff --git a/gradle.properties b/gradle.properties index 39aff5a..6bcdeda 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,5 +14,5 @@ org.gradle.parallel=true archives_base_name = chipmunkmod # Dependencies - fabric_version=0.80.0+1.19.4 + fabric_version=0.81.1+1.19.4 diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatScreenMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatScreenMixin.java index 9fec4fe..32218d8 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatScreenMixin.java +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/ChatScreenMixin.java @@ -6,6 +6,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyArg; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.client.MinecraftClient; @@ -38,4 +39,9 @@ public class ChatScreenMixin { public void init (CallbackInfo ci) { chatField.setMaxLength(Integer.MAX_VALUE); } + + @ModifyArg(method = "normalize", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncateChat(Ljava/lang/String;)Ljava/lang/String;")) + private String normalize (String text) { + return text; + } } diff --git a/src/main/java/land/chipmunk/chipmunkmod/mixin/StringHelperMixin.java b/src/main/java/land/chipmunk/chipmunkmod/mixin/StringHelperMixin.java new file mode 100644 index 0000000..4801f6e --- /dev/null +++ b/src/main/java/land/chipmunk/chipmunkmod/mixin/StringHelperMixin.java @@ -0,0 +1,20 @@ +package land.chipmunk.chipmunkmod.mixin; + +import net.minecraft.util.StringHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; + +@Mixin(StringHelper.class) +public class StringHelperMixin { + // totallynotskidded™ from meteor client + @ModifyArg(method = "truncateChat", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringHelper;truncate(Ljava/lang/String;IZ)Ljava/lang/String;")) + private static int truncateChat(int maxLength) { + return Integer.MAX_VALUE; + } + + @ModifyArg(method = "stripTextFormat", at = @At(value = "INVOKE", target = "Ljava/util/regex/Matcher;replaceAll(Ljava/lang/String;)Ljava/lang/String;")) + private static String stripTextFormat (String replacement) { + return replacement; + } +} diff --git a/src/main/resources/chipmunkmod.mixins.json b/src/main/resources/chipmunkmod.mixins.json index 8bd5556..e6a2726 100644 --- a/src/main/resources/chipmunkmod.mixins.json +++ b/src/main/resources/chipmunkmod.mixins.json @@ -13,7 +13,8 @@ "ClientPlayNetworkHandlerMixin", "MinecraftClientAccessor", "LightmapTextureManagerMixin", - "DecoderHandlerMixin" + "DecoderHandlerMixin", + "StringHelperMixin" ], "injectors": { "defaultRequire": 1