Convert color codes in tempban and tempbanip (#5726)

This commit is contained in:
Charles DeLancey 2024-03-05 14:58:57 -05:00 committed by GitHub
parent c19b20ea3b
commit 3817a11d9d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -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")) {

View File

@ -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")) {