Master builder title, resolves #36

This commit is contained in:
ZeroEpoch1969 2018-05-11 20:09:23 -07:00
parent 83017e518d
commit 1371e23d59
No known key found for this signature in database
GPG key ID: E0AAB104FB9F8FDF
5 changed files with 12 additions and 25 deletions

View file

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.checkstyle.format>true</netbeans.checkstyle.format>
</properties>
</project-shared-configuration>

View file

@ -43,6 +43,7 @@ public enum ConfigEntry
SERVER_ADDRESS(String.class, "server.address"),
SERVER_MOTD(String.class, "server.motd"),
SERVER_OWNERS(List.class, "server.owners"),
MASTER_BUILDERS(List.class, "server.master_builders"),
SERVER_BAN_URL(String.class, "server.ban_url"),
SERVER_PERMBAN_URL(String.class, "server.permban_url"),
//

View file

@ -49,6 +49,12 @@ public class RankManager extends FreedomService
return Rank.IMPOSTOR;
}
// Master builders show up if they are not admins
if (ConfigEntry.MASTER_BUILDERS.getList().contains(player.getName()) && !plugin.al.isAdmin(player))
{
return Title.MASTER_BUILDER;
}
// Developers always show up
if (FUtil.DEVELOPERS.contains(player.getName()))
{
@ -177,7 +183,7 @@ public class RankManager extends FreedomService
}
// Set display
if (isAdmin || FUtil.DEVELOPERS.contains(player.getName()))
if (isAdmin || FUtil.DEVELOPERS.contains(player.getName()) || ConfigEntry.MASTER_BUILDERS.getList().contains(player.getName().toLowerCase()))
{
final Displayable display = getDisplay(player);
String loginMsg = display.getColoredLoginMessage();

View file

@ -6,6 +6,7 @@ import org.bukkit.ChatColor;
public enum Title implements Displayable
{
MASTER_BUILDER("a", "Master Builder", ChatColor.DARK_AQUA, "Master-Builder"),
DEVELOPER("a", "Developer", ChatColor.DARK_PURPLE, "Dev"),
OWNER("the", "Owner", ChatColor.BLUE, "Owner");
@ -43,10 +44,4 @@ public enum Title implements Displayable
return determiner + " " + color + ChatColor.ITALIC + name;
}
@Override
public String getAbbr()
{
return abbr;
}
}

View file

@ -21,6 +21,9 @@ server:
owners:
- TheMinecraft
# All players who show up as Master Builder
master_builders: []
# URL players should appeal for bans at
ban_url: http://totalfreedom.boards.net/