Skip to content

Commit

Permalink
fix: fix /f list not working with trim line separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Jan 16, 2022
1 parent cad8665 commit 8c029c1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class GuiUtilRenderComponentsMixin_TrimLineBreaker {

@Dynamic
@Redirect(method = "splitText", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z", ordinal = 1))
private static boolean trimLineSeperator(List<IChatComponent> list, Object obj) {
private static boolean trimLineSeparator(List<IChatComponent> list, Object obj) {
boolean value = false;
if (obj instanceof IChatComponent) {
value = list.add((IChatComponent) obj);
Expand All @@ -47,7 +47,7 @@ private static boolean trimLineSeperator(List<IChatComponent> list, Object obj)
i++;
String s = EnumChatFormatting.getTextWithoutFormattingCodes(component.getUnformattedText());

if ((s.startsWith("-") && s.endsWith("-")) || (s.startsWith("▬") && s.endsWith("▬")) || (s.startsWith("≡") && s.endsWith("≡"))) {
if ((s.startsWith("---") && s.endsWith("---")) || (s.startsWith("▬▬▬") && s.endsWith("▬▬▬")) || (s.startsWith("≡≡≡") && s.endsWith("≡≡≡"))) {
if (seperatorFound) {
remove.add(i);
} else {
Expand Down

0 comments on commit 8c029c1

Please sign in to comment.