Fix escape formatting (#5)
Fix escape formatting and refactor BlockEvent Signed-off-by: Etzelia <etzelia@hotmail.com> Reviewed-on: https://git.etztech.xyz/Minecraft/MineAlert/pulls/5 Reviewed-by: ZeroHD <joey@ahines.net>master
parent
cff2af302f
commit
23356da050
|
@ -74,9 +74,9 @@ public class GriefAlertListener implements Listener {
|
||||||
extra.append(" and pinging Discord");
|
extra.append(" and pinging Discord");
|
||||||
Embed embed = new Embed()
|
Embed embed = new Embed()
|
||||||
.color(color.getInt())
|
.color(color.getInt())
|
||||||
.description(alert)
|
.description(Javacord.escapeFormat(alert))
|
||||||
.timestamp(OffsetDateTime.now())
|
.timestamp(OffsetDateTime.now())
|
||||||
.author(new Author(Javacord.escapeFormat(playerName),
|
.author(new Author(playerName,
|
||||||
!"".equals(usernameURL) ? usernameURL : "",
|
!"".equals(usernameURL) ? usernameURL : "",
|
||||||
String.format("https://minotar.net/helm/%s/100.png", playerName),
|
String.format("https://minotar.net/helm/%s/100.png", playerName),
|
||||||
""));
|
""));
|
||||||
|
|
|
@ -200,9 +200,9 @@ public class OreAlertListener implements Listener {
|
||||||
if (!"".equals(webhook)) {
|
if (!"".equals(webhook)) {
|
||||||
Embed embed = new Embed()
|
Embed embed = new Embed()
|
||||||
.color(Color.hexToInt(hexColor))
|
.color(Color.hexToInt(hexColor))
|
||||||
.description(message)
|
.description(Javacord.escapeFormat(message))
|
||||||
.timestamp(OffsetDateTime.now())
|
.timestamp(OffsetDateTime.now())
|
||||||
.author(new Author(Javacord.escapeFormat(event.getPlayer().getName()),
|
.author(new Author(event.getPlayer().getName(),
|
||||||
!"".equals(usernameURL) ? usernameURL : "",
|
!"".equals(usernameURL) ? usernameURL : "",
|
||||||
String.format("https://minotar.net/helm/%s/100.png", event.getPlayer().getName()),
|
String.format("https://minotar.net/helm/%s/100.png", event.getPlayer().getName()),
|
||||||
""));
|
""));
|
||||||
|
@ -227,9 +227,8 @@ public class OreAlertListener implements Listener {
|
||||||
public static Queue<BlockEvent> getQueue() {
|
public static Queue<BlockEvent> getQueue() {
|
||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class BlockEvent {
|
private static class BlockEvent {
|
||||||
private final Player player;
|
private final Player player;
|
||||||
private final Material material;
|
private final Material material;
|
||||||
private final Location location;
|
private final Location location;
|
||||||
|
@ -263,4 +262,5 @@ class BlockEvent {
|
||||||
public Date getTime() {
|
public Date getTime() {
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue