Dont add duplicates to history (console and chat) (#10710)
* Dont add duplicates to history * redundant parenthesis removal
This commit is contained in:
@@ -201,7 +201,7 @@ public class ChatFragment extends Table{
|
||||
//avoid sending prefix-empty messages
|
||||
if(message.isEmpty() || (message.startsWith(mode.prefix) && message.substring(mode.prefix.length()).isEmpty())) return;
|
||||
|
||||
history.insert(1, message);
|
||||
if(history.size < 2 || !history.get(1).equals(message)) history.insert(1, message);
|
||||
|
||||
message = UI.formatIcons(message);
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ public class ConsoleFragment extends Table{
|
||||
return;
|
||||
}
|
||||
|
||||
history.insert(1, message);
|
||||
if(history.size < 2 || !history.get(1).equals(message)) history.insert(1, message);
|
||||
|
||||
addMessage("[lightgray]> " + message.replace("[", "[["));
|
||||
addMessage(mods.getScripts().runConsole(injectConsoleVariables() + message).replace("[", "[["));
|
||||
|
||||
Reference in New Issue
Block a user