SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'UserPerm' (#244) from user-perm into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #244
Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Lixfel 2023-08-29 21:33:25 +02:00
Commit 0a28571b01
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());
}