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_ADDRESS(String.class, "server.address"),
SERVER_MOTD(String.class, "server.motd"), SERVER_MOTD(String.class, "server.motd"),
SERVER_OWNERS(List.class, "server.owners"), SERVER_OWNERS(List.class, "server.owners"),
MASTER_BUILDERS(List.class, "server.master_builders"),
SERVER_BAN_URL(String.class, "server.ban_url"), SERVER_BAN_URL(String.class, "server.ban_url"),
SERVER_PERMBAN_URL(String.class, "server.permban_url"), SERVER_PERMBAN_URL(String.class, "server.permban_url"),
// //

View File

@ -49,6 +49,12 @@ public class RankManager extends FreedomService
return Rank.IMPOSTOR; 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 // Developers always show up
if (FUtil.DEVELOPERS.contains(player.getName())) if (FUtil.DEVELOPERS.contains(player.getName()))
{ {
@ -177,7 +183,7 @@ public class RankManager extends FreedomService
} }
// Set display // 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); final Displayable display = getDisplay(player);
String loginMsg = display.getColoredLoginMessage(); String loginMsg = display.getColoredLoginMessage();

View File

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

View File

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