SteamWar/SpigotCore
Archiviert
13
0

UserPerm #244

Zusammengeführt
Lixfel hat 1 Commits von user-perm nach master 2023-08-29 21:33:25 +02:00 zusammengeführt
2 geänderte Dateien mit 6 neuen und 6 gelöschten Zeilen

@ -1 +1 @@
Subproject commit 0fef6c0f8f5499cc3a74aea38d51abbe97ba11c2
Subproject commit 4eadcb4b09c0747cd1726c7f6cfe86ff07e59ea2

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.core.events;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserGroup;
import de.steamwar.sql.UserPerm;
import de.steamwar.sql.internal.Statement;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@ -37,11 +37,11 @@ public class PlayerJoinedEvent implements Listener{
Player player = event.getPlayer();
SteamwarUser user = Statement.productionDatabase() ? SteamwarUser.get(player.getUniqueId()) : SteamwarUser.getOrCreate(player.getUniqueId(), player.getName(), uuid -> {}, (oldName, newName) -> {});
if(user.getUserGroup() != UserGroup.Member) {
UserGroup group = user.getUserGroup();
player.setDisplayName(group.getColorCode() + group.name() + " " + player.getName() + "§r");
UserPerm.Prefix prefix = user.prefix();
if(prefix != UserPerm.emptyPrefix) {
player.setDisplayName(prefix.getColorCode() + prefix.getChatPrefix() + " " + player.getName() + "§r");
} else
player.setDisplayName(user.getUserGroup().getColorCode() + player.getName() + "§r");
player.setDisplayName(prefix.getColorCode() + player.getName() + "§r");
event.setJoinMessage("§a§l» §r" + player.getDisplayName());
}