Merge pull request 'UserPerm' (#244) from user-perm into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Reviewed-on: #244 Reviewed-by: Chaoscaot <chaoscaot@zohomail.eu>
Dieser Commit ist enthalten in:
Commit
0a28571b01
@ -1 +1 @@
|
|||||||
Subproject commit 0fef6c0f8f5499cc3a74aea38d51abbe97ba11c2
|
Subproject commit 4eadcb4b09c0747cd1726c7f6cfe86ff07e59ea2
|
@ -20,7 +20,7 @@
|
|||||||
package de.steamwar.core.events;
|
package de.steamwar.core.events;
|
||||||
|
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import de.steamwar.sql.UserGroup;
|
import de.steamwar.sql.UserPerm;
|
||||||
import de.steamwar.sql.internal.Statement;
|
import de.steamwar.sql.internal.Statement;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@ -37,11 +37,11 @@ public class PlayerJoinedEvent implements Listener{
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
SteamwarUser user = Statement.productionDatabase() ? SteamwarUser.get(player.getUniqueId()) : SteamwarUser.getOrCreate(player.getUniqueId(), player.getName(), uuid -> {}, (oldName, newName) -> {});
|
SteamwarUser user = Statement.productionDatabase() ? SteamwarUser.get(player.getUniqueId()) : SteamwarUser.getOrCreate(player.getUniqueId(), player.getName(), uuid -> {}, (oldName, newName) -> {});
|
||||||
|
|
||||||
if(user.getUserGroup() != UserGroup.Member) {
|
UserPerm.Prefix prefix = user.prefix();
|
||||||
UserGroup group = user.getUserGroup();
|
if(prefix != UserPerm.emptyPrefix) {
|
||||||
player.setDisplayName(group.getColorCode() + group.name() + " " + player.getName() + "§r");
|
player.setDisplayName(prefix.getColorCode() + prefix.getChatPrefix() + " " + player.getName() + "§r");
|
||||||
} else
|
} else
|
||||||
player.setDisplayName(user.getUserGroup().getColorCode() + player.getName() + "§r");
|
player.setDisplayName(prefix.getColorCode() + player.getName() + "§r");
|
||||||
|
|
||||||
event.setJoinMessage("§a§l» §r" + player.getDisplayName());
|
event.setJoinMessage("§a§l» §r" + player.getDisplayName());
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren