Fixed HTML formatting (#57)

Fixed HTML formatting

+ `markup=true` for creating markers
+ Bumped marker name length to 50 chars
+ Escaped HTML from marker names

Co-authored-by: Joey Hines <joey@ahines.net>
Reviewed-on: https://git.etztech.xyz/Minecraft/QoL/pulls/57
Reviewed-by: Etzelia <etzelia@hotmail.com>
grief
Joey Hines 2020-07-29 23:12:52 +02:00 committed by Etzelia
parent 7f7c00e22b
commit cc11677a18
2 changed files with 5 additions and 2 deletions

View File

@ -329,7 +329,7 @@ public class QoL extends JavaPlugin {
playerMarker.deleteMarker();
}
playerMarkerSet.createMarker(getMarkerName(player, name), name, player.getWorld().getName(), location.getX(), location.getY(), location.getZ(), icon, true);
playerMarkerSet.createMarker(getMarkerName(player, name), name, true, player.getWorld().getName(), location.getX(), location.getY(), location.getZ(), icon, true);
}
public Marker getPlayerMarker(Player player, String name) {

View File

@ -12,6 +12,7 @@ import org.dynmap.markers.MarkerSet;
import xyz.etztech.qol.EtzTechUtil;
import xyz.etztech.qol.Lang;
import xyz.etztech.qol.QoL;
import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
import java.util.Arrays;
import java.util.List;
@ -58,7 +59,9 @@ public class MarkerCommand implements CommandExecutor, TabExecutor{
name = (player).getDisplayName();
}
if (name.length() > 25) {
name = escapeHtml(name);
if (name.length() > 50) {
EtzTechUtil.sms(player, ChatColor.RED + "Marker name too long, try a shorter name");
return true;
}