From 3cb5eac639114d2a2ce197364638db8dd5126745 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Wed, 18 Nov 2020 14:03:52 +0100 Subject: [PATCH] Fixing Everything --- src/de/steamwar/bungeecore/BungeeCore.java | 2 +- src/de/steamwar/bungeecore/commands/BanCommand.java | 2 +- src/de/steamwar/bungeecore/commands/MuteCommand.java | 2 +- src/de/steamwar/bungeecore/sql/Punishment.java | 2 +- src/de/steamwar/bungeecore/sql/SteamwarUser.java | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index ce64862..843ba1b 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -54,7 +54,7 @@ public class BungeeCore extends Plugin { public static final String SERVER_TEAMCHAT_PREFIX = "§8STC §e"; public static final String TEAMCHAT_PREFIX = "§8TC §e"; - public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("HH:mm dd.MM.yyyy"); + public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm"); public static String CHAT_PREFIX; public static String WORLD_FOLDER; diff --git a/src/de/steamwar/bungeecore/commands/BanCommand.java b/src/de/steamwar/bungeecore/commands/BanCommand.java index 0e6e55b..159e07e 100644 --- a/src/de/steamwar/bungeecore/commands/BanCommand.java +++ b/src/de/steamwar/bungeecore/commands/BanCommand.java @@ -56,7 +56,7 @@ public class BanCommand extends BasicCommand { } String msg = banReason.toString(); target.ban(banTime, msg, SteamwarUser.get(sender.getName()).getId(), args[1].equalsIgnoreCase("perma")); - ServerTeamchatCommand.sendToTeam(BungeeCore.CHAT_PREFIX + target.getUserGroup().getColorCode() + target.getUserName() + "§c wurde von " + SteamwarUser.get(sender.getName()).getUserGroup().getColorCode() + sender.getName() + " §c" + (args[1].equalsIgnoreCase("perma")?"Permanent":"bis zum " + banTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT)) + " gebannt. §f§lGrund: §f" + banReason); + ServerTeamchatCommand.sendToTeam(BungeeCore.CHAT_PREFIX + "§c" + target.getUserName() + " wurde von " + sender.getName() + " §c" + (args[1].equalsIgnoreCase("perma")?"Permanent":"bis zum " + banTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT)) + " gebannt. §f§lGrund: §f" + banReason); } public static Timestamp parseTime(CommandSender sender, String arg){ diff --git a/src/de/steamwar/bungeecore/commands/MuteCommand.java b/src/de/steamwar/bungeecore/commands/MuteCommand.java index 7590d22..ac53d05 100644 --- a/src/de/steamwar/bungeecore/commands/MuteCommand.java +++ b/src/de/steamwar/bungeecore/commands/MuteCommand.java @@ -52,6 +52,6 @@ public class MuteCommand extends BasicCommand { } String msg = muteReason.toString(); target.mute(muteTime, msg, SteamwarUser.get(sender.getName()).getId(), args[1].equalsIgnoreCase("perma")); - ServerTeamchatCommand.sendToTeam(BungeeCore.CHAT_PREFIX + target.getUserGroup().getColorCode() + target.getUserName() + "§c wurde von " + SteamwarUser.get(sender.getName()).getUserGroup().getColorCode() + sender.getName() + " §c" + (args[1].equalsIgnoreCase("perma")?"Permanent":"bis zum " + muteTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT)) + " gemuted. §f§lGrund: §f" + muteReason); + ServerTeamchatCommand.sendToTeam(BungeeCore.CHAT_PREFIX + "§c" + target.getUserName() + " wurde von " + sender.getName() + " §c" + (args[1].equalsIgnoreCase("perma")?"Permanent":"bis zum " + muteTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT)) + " gemuted. §f§lGrund: §f" + muteReason); } } diff --git a/src/de/steamwar/bungeecore/sql/Punishment.java b/src/de/steamwar/bungeecore/sql/Punishment.java index abd3bee..72e5c0a 100644 --- a/src/de/steamwar/bungeecore/sql/Punishment.java +++ b/src/de/steamwar/bungeecore/sql/Punishment.java @@ -63,7 +63,7 @@ public class Punishment { } } - public static Punishment createPunishment(int user, int executor, PunishmentType type, String reason, Timestamp endTime, Boolean perma) { + public static Punishment createPunishment(int user, int executor, PunishmentType type, String reason, Timestamp endTime, boolean perma) { SQL.update("INSERT INTO Punishments (UserId, Punisher, Type, Reason, EndTime, Perma) VALUES (?, ?, ?, ?, ?, ?)", user, executor, type.name(), reason, endTime, perma); return getPunishmentOfPlayer(user, type); diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index 8fc30fe..0916686 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -153,6 +153,7 @@ public class SteamwarUser { return false; if(!isCurrent(punishments.get(Punishment.PunishmentType.Ban))) { SQL.update("DELETE FROM BannedUserIPs WHERE UserID = ?", id); + punishments.remove(Punishment.PunishmentType.Ban); return false; } return true; @@ -210,7 +211,7 @@ public class SteamwarUser { public void mute(Timestamp time, String muteReason, int from, boolean perma){ if(isMuted()) { - punishments.get(Punishment.PunishmentType.Ban).updateEndTime(from, muteReason, time, perma); + punishments.get(Punishment.PunishmentType.Mute).updateEndTime(from, muteReason, time, perma); return; } punishments.remove(Punishment.PunishmentType.Mute);