Move ChatCommandsPlugin#sanitize to Text
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -62,6 +62,7 @@ import net.runelite.client.input.KeyManager;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
import static net.runelite.client.util.Text.sanitize;
|
||||
import net.runelite.http.api.chat.ChatClient;
|
||||
import net.runelite.http.api.hiscore.HiscoreClient;
|
||||
import net.runelite.http.api.hiscore.HiscoreEndpoint;
|
||||
@@ -792,19 +793,6 @@ public class ChatCommandsPlugin extends Plugin
|
||||
return shortest;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the ironman status icon from playername string if present and
|
||||
* corrects spaces.
|
||||
*
|
||||
* @param lookup Playername to lookup.
|
||||
* @return Cleaned playername.
|
||||
*/
|
||||
private static String sanitize(String lookup)
|
||||
{
|
||||
String cleaned = lookup.contains("<img") ? lookup.substring(lookup.lastIndexOf('>') + 1) : lookup;
|
||||
return cleaned.replace('\u00A0', ' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the ironman status of the local player. Does NOT work on other players.
|
||||
*
|
||||
|
||||
@@ -146,4 +146,17 @@ public class Text
|
||||
|
||||
return out.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the ironman status icon from playername string if present and
|
||||
* corrects spaces.
|
||||
*
|
||||
* @param name Playername to lookup.
|
||||
* @return Cleaned playername.
|
||||
*/
|
||||
public static String sanitize(String name)
|
||||
{
|
||||
String cleaned = name.contains("<img") ? name.substring(name.lastIndexOf('>') + 1) : name;
|
||||
return cleaned.replace('\u00A0', ' ');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user