From 6f346591ea23ce2177f38bd2ee806d851e1d11e8 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 29 Aug 2023 21:15:01 +0200 Subject: [PATCH] UserPerm --- CommonCore | 2 +- .../src/de/steamwar/core/events/PlayerJoinedEvent.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CommonCore b/CommonCore index 0fef6c0..4eadcb4 160000 --- a/CommonCore +++ b/CommonCore @@ -1 +1 @@ -Subproject commit 0fef6c0f8f5499cc3a74aea38d51abbe97ba11c2 +Subproject commit 4eadcb4b09c0747cd1726c7f6cfe86ff07e59ea2 diff --git a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java index fe342bd..8936de9 100644 --- a/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java +++ b/SpigotCore_Main/src/de/steamwar/core/events/PlayerJoinedEvent.java @@ -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()); } -- 2.39.2