From cc11677a18ec50e1bbd8353f1d5ec70d21cc8bad Mon Sep 17 00:00:00 2001 From: ZeroHD Date: Wed, 29 Jul 2020 23:12:52 +0200 Subject: [PATCH] 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 Reviewed-on: https://git.etztech.xyz/Minecraft/QoL/pulls/57 Reviewed-by: Etzelia --- src/main/java/xyz/etztech/qol/QoL.java | 2 +- src/main/java/xyz/etztech/qol/commands/MarkerCommand.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/xyz/etztech/qol/QoL.java b/src/main/java/xyz/etztech/qol/QoL.java index cc77273..9fa8900 100644 --- a/src/main/java/xyz/etztech/qol/QoL.java +++ b/src/main/java/xyz/etztech/qol/QoL.java @@ -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) { diff --git a/src/main/java/xyz/etztech/qol/commands/MarkerCommand.java b/src/main/java/xyz/etztech/qol/commands/MarkerCommand.java index 6bf1c12..855076f 100644 --- a/src/main/java/xyz/etztech/qol/commands/MarkerCommand.java +++ b/src/main/java/xyz/etztech/qol/commands/MarkerCommand.java @@ -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; }