From 3817a11d9d8ba407fc407f8dc8b113f4601c13ba Mon Sep 17 00:00:00 2001 From: Charles DeLancey <46200123+Evidentsinger14@users.noreply.github.com> Date: Tue, 5 Mar 2024 14:58:57 -0500 Subject: [PATCH] Convert color codes in tempban and tempbanip (#5726) --- .../java/com/earth2me/essentials/commands/Commandtempban.java | 3 ++- .../com/earth2me/essentials/commands/Commandtempbanip.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempban.java index 7c785a835..fde30d244 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempban.java @@ -6,6 +6,7 @@ import com.earth2me.essentials.IUser; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.AdventureUtil; import com.earth2me.essentials.utils.DateUtil; +import com.earth2me.essentials.utils.FormatUtil; import org.bukkit.BanList; import org.bukkit.Server; @@ -36,7 +37,7 @@ public class Commandtempban extends EssentialsCommand { } final String time = getFinalArg(args, 1); final long banTimestamp = DateUtil.parseDateDiff(time, true); - String banReason = DateUtil.removeTimePattern(time); + String banReason = FormatUtil.replaceFormat(DateUtil.removeTimePattern(time)); final long maxBanLength = ess.getSettings().getMaxTempban() * 1000; if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.tempban.unlimited")) { diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempbanip.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempbanip.java index 4b0865740..e3105dfa9 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempbanip.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandtempbanip.java @@ -49,7 +49,7 @@ public class Commandtempbanip extends EssentialsCommand { final String time = getFinalArg(args, 1); final long banTimestamp = DateUtil.parseDateDiff(time, true); - String banReason = DateUtil.removeTimePattern(time); + String banReason = FormatUtil.replaceFormat(DateUtil.removeTimePattern(time)); final long maxBanLength = ess.getSettings().getMaxTempban() * 1000; if (maxBanLength > 0 && ((banTimestamp - GregorianCalendar.getInstance().getTimeInMillis()) > maxBanLength) && sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.tempban.unlimited")) {