From 5b756ab152f0e2a1d094da31dc22a7b824e81c24 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 11 Dec 2013 18:09:41 +0000 Subject: [PATCH] Fix new lines break URL matching --- CraftBukkit-Patches/0066-Fix-links-in-chat.patch | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0066-Fix-links-in-chat.patch b/CraftBukkit-Patches/0066-Fix-links-in-chat.patch index 4be3796fd..cb202975e 100644 --- a/CraftBukkit-Patches/0066-Fix-links-in-chat.patch +++ b/CraftBukkit-Patches/0066-Fix-links-in-chat.patch @@ -1,11 +1,11 @@ -From 90653e58b284b1b1f0304d409faf40c6c8039bd8 Mon Sep 17 00:00:00 2001 +From e36d608f7f0a8fc2ea06b381311a394f8d6ed123 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 1 Dec 2013 10:33:55 +0000 Subject: [PATCH] Fix links in chat diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index cc8e715..22d1346 100644 +index cc8e715..5607df1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -3,11 +3,15 @@ package org.bukkit.craftbukkit.util; @@ -48,7 +48,14 @@ index cc8e715..22d1346 100644 if (builder.length() > 0) { appendNewComponent(); } -@@ -78,6 +88,11 @@ public final class CraftChatMessage { +@@ -73,11 +83,18 @@ public final class CraftChatMessage { + } + i++; + } else if (currentChar == '\n') { ++ checkUrl(matcher, message, i); ++ lastWord = i + 1; + if (builder.length() > 0) { + appendNewComponent(); } currentChatComponent = null; } else { @@ -60,7 +67,7 @@ index cc8e715..22d1346 100644 builder.append(currentChar); } } -@@ -89,6 +104,31 @@ public final class CraftChatMessage { +@@ -89,6 +106,31 @@ public final class CraftChatMessage { output = list.toArray(new IChatBaseComponent[0]); }