Archiviert
1
0

Changing Messages

Dieser Commit ist enthalten in:
Chaoscaot 2020-11-23 18:26:04 +01:00
Ursprung 2d9f686ba8
Commit 01f40b9440
3 geänderte Dateien mit 17 neuen und 7 gelöschten Zeilen

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.sql;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import java.sql.ResultSet;
import java.sql.SQLException;
@ -136,7 +137,7 @@ public class Punishment {
public String getBantime(Timestamp endTime, boolean perma) {
if(perma)
return "Permanent";
return Message.parse("BAN_PERMA", SteamwarUser.get(user).getPlayer());
else
return endTime.toLocalDateTime().format(BungeeCore.DATE_FORMAT);
}

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bungeecore.sql;
import de.steamwar.bungeecore.BungeeCore;
import de.steamwar.bungeecore.Message;
import de.steamwar.bungeecore.commands.WebregisterCommand;
import de.steamwar.bungeecore.listeners.ConnectionListener;
import net.md_5.bungee.api.ProxyServer;
@ -148,6 +149,10 @@ public class SteamwarUser {
return team;
}
public ProxiedPlayer getPlayer() {
return BungeeCore.get().getProxy().getPlayer(uuid);
}
public boolean isBanned() {
if(!punishments.containsKey(Punishment.PunishmentType.Ban))
return false;
@ -172,20 +177,19 @@ public class SteamwarUser {
public TextComponent banMessage(){
Punishment punishment = punishments.get(Punishment.PunishmentType.Ban);
if (punishment.isPerma()) {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + "§cDu bist permanent gebannt. §r§lGrund§r: §c" + punishment.getReason());
return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_PERMA", getPlayer(), punishment.getReason()));
} else {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + " Du bist bis zum " +
punishment.getEndTime().toLocalDateTime().format(BungeeCore.DATE_FORMAT) + " gebannt. §r§lGrund§r: §c" + punishment.getReason());
return BungeeCore.stringToText(Message.parsePrefixed("BANNED_MESSAGE_UNTIL", getPlayer(), punishment.getEndTime().toLocalDateTime().format(BungeeCore.DATE_FORMAT),
punishment.getReason()));
}
}
public TextComponent muteMessage(){
Punishment punishment = punishments.get(Punishment.PunishmentType.Mute);
if (punishment.isPerma()) {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + "§cDu bist permanent gemuted. §r§lGrund§r: §c" + punishment.getReason());
return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_PERMA", getPlayer(), punishment.getReason()));
} else {
return BungeeCore.stringToText(BungeeCore.CHAT_PREFIX + " Du bist bis zum " +
punishment.getEndTime().toLocalDateTime().format(BungeeCore.DATE_FORMAT) + " gemuted. §r§lGrund§r: §c" + punishment.getReason());
return BungeeCore.stringToText(Message.parsePrefixed("MUTED_MESSAGE_UNTIL",getPlayer(), punishment.getEndTime().toLocalDateTime().format(BungeeCore.DATE_FORMAT), punishment.getReason()));
}
}

Datei anzeigen

@ -68,7 +68,12 @@ USAGE_IGNORE=§8/§7ignore §8[§eSpieler§8]
ALERT=§f{0}
BAN_TEAM_BANNED=§c {0} wurde von {1} {2} gebannt. §f§lGrund: §f{3}
BANNED_MESSAGE_PERMA=§cDu bist permanent gebannt. §r§lGrund§r: §c{0}
BANNED_MESSAGE_UNTIL=Du bist bis zum {0} gebannt. §r§lGrund§r: §c{1}
MUTE_TEAM_MUTED=§c {0} wurde von {1} {2} gemuted. §f§lGrund: §f{3}
MUTED_MESSAGE_PERMA=§cDu bist permanent gemuted. §r§lGrund§r: §c{0}
MUTED_MESSAGE_UNTIL=Du bist bis zum {0} gemuted. §r§lGrund§r: §c{1}
BAN_CHANGED={0} verändert von {1} von
BAN_INVALID_TIME=§cUngültige Zeitangabe.
BAN_PERMA=Permanent
BAN_UNTIL=bis zum