Add boolean for nicknames allow changing user/nick name
This commit is contained in:
parent
4d8b7b60f6
commit
3671d33dc7
|
|
@ -13,11 +13,12 @@ import java.util.*;
|
||||||
public class DiscordLinkPlayer {
|
public class DiscordLinkPlayer {
|
||||||
private final long userId;
|
private final long userId;
|
||||||
private final UUID uuid;
|
private final UUID uuid;
|
||||||
private final String username;
|
private String username;
|
||||||
private final String discordUsername;
|
private String discordUsername;
|
||||||
|
private boolean nick;
|
||||||
private final List<String> roleNames;
|
private final List<String> roleNames;
|
||||||
|
|
||||||
public DiscordLinkPlayer(long userId, UUID uuid, String username, String discordUsername, List<String> roleNames) {
|
public DiscordLinkPlayer(long userId, UUID uuid, String username, String discordUsername, boolean nick, List<String> roleNames) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.username = username;
|
this.username = username;
|
||||||
|
|
@ -37,6 +38,10 @@ public class DiscordLinkPlayer {
|
||||||
return username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
public List<String> getRoles() {
|
public List<String> getRoles() {
|
||||||
return roleNames;
|
return roleNames;
|
||||||
}
|
}
|
||||||
|
|
@ -45,6 +50,18 @@ public class DiscordLinkPlayer {
|
||||||
return discordUsername;
|
return discordUsername;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setDiscordUsername(String discordUsername) {
|
||||||
|
this.discordUsername = discordUsername;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasNick() {
|
||||||
|
return nick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNick(boolean nick) {
|
||||||
|
this.nick = nick;
|
||||||
|
}
|
||||||
|
|
||||||
public void updateDiscord(List<DiscordRole> roles, boolean added) {
|
public void updateDiscord(List<DiscordRole> roles, boolean added) {
|
||||||
if (added)
|
if (added)
|
||||||
roles.stream().filter(DiscordRole::isUpdateToDiscord).forEach(role -> DiscordLink.getPlugin().getBot().addRole(userId, role.getId(), BotConfig.GUILD_ID)); //TODO test
|
roles.stream().filter(DiscordRole::isUpdateToDiscord).forEach(role -> DiscordLink.getPlugin().getBot().addRole(userId, role.getId(), BotConfig.GUILD_ID)); //TODO test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user