SteamWar/BungeeCore
Archiviert
13
2

Fixing Everything

Dieser Commit ist enthalten in:
Chaoscaot 2020-11-18 14:03:52 +01:00
Ursprung 4137ebb61b
Commit 3cb5eac639
5 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -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;

Datei anzeigen

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

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);

Datei anzeigen

@ -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);