mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
Fixed inconsistencies in description fields within home lists; they are now properly escaped by MineDown
This commit is contained in:
1 parent
815ef51fd1
commit
45c7cddc2c
3 files changed
+15
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package me.william278.huskhomes2.commands;
|
||||
|
||||
import de.themoep.minedown.MineDown;
|
||||
import me.william278.huskhomes2.HuskHomes;
|
||||
import me.william278.huskhomes2.MessageManager;
|
||||
import me.william278.huskhomes2.data.DataManager;
|
||||
@@ -66,7 +67,10 @@ public class HomeListCommand extends CommandBase {
|
||||
|
||||
ArrayList<String> homeList = new ArrayList<>();
|
||||
for (Home home : homes) {
|
||||
homeList.add(MessageManager.getRawMessage("home_list_item", home.getName(), home.getDescription()));
|
||||
homeList.add(MessageManager.getRawMessage("home_list_item", home.getName(), MineDown.escape(home.getDescription().replace("]", "\\]")
|
||||
.replace("[", "\\[")
|
||||
.replace("(", "\\(")
|
||||
.replace(")", "\\)"))));
|
||||
}
|
||||
|
||||
final int itemsPerPage = HuskHomes.getSettings().getPrivateHomesPerPage();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package me.william278.huskhomes2.commands;
|
||||
|
||||
import de.themoep.minedown.MineDown;
|
||||
import me.william278.huskhomes2.HuskHomes;
|
||||
import me.william278.huskhomes2.MessageManager;
|
||||
import me.william278.huskhomes2.data.DataManager;
|
||||
@@ -43,7 +44,10 @@ public class PublicHomeListCommand extends CommandBase {
|
||||
}
|
||||
ArrayList<String> publicHomeList = new ArrayList<>();
|
||||
for (Home home : homes) {
|
||||
publicHomeList.add(MessageManager.getRawMessage("public_home_list_item", home.getName(), home.getOwnerUsername(), home.getDescription()));
|
||||
publicHomeList.add(MessageManager.getRawMessage("public_home_list_item", home.getName(), home.getOwnerUsername(), MineDown.escape(home.getDescription().replace("]", "\\]")
|
||||
.replace("[", "\\[")
|
||||
.replace("(", "\\(")
|
||||
.replace(")", "\\)"))));
|
||||
}
|
||||
|
||||
final int itemsPerPage = HuskHomes.getSettings().getPublicHomesPerPage();
|
||||
|
||||
@@ -47,7 +47,11 @@ public class WarpListCommand extends CommandBase {
|
||||
}
|
||||
}
|
||||
}
|
||||
warpList.add(MessageManager.getRawMessage("warp_list_item", warp.getName(), MineDown.escape(warp.getDescription().replace("]", "]").replace("[", "[").replace("(", "❲").replace(")", "❳"))));
|
||||
warpList.add(MessageManager.getRawMessage("warp_list_item", warp.getName(),
|
||||
MineDown.escape(warp.getDescription().replace("]", "\\]")
|
||||
.replace("[", "\\[")
|
||||
.replace("(", "\\(")
|
||||
.replace(")", "\\)"))));
|
||||
}
|
||||
if (warpList.isEmpty()) {
|
||||
MessageManager.sendMessage(player, "error_no_warps_set");
|
||||
|
||||
Reference in new issue
Block a user