Increment to v2.9

Add "Login Title Message Customization"
This commit is contained in:
Steven Lawson 2012-11-11 13:11:06 -05:00
parent 40bfd059f1
commit 774ca0cf0a
4 changed files with 44 additions and 20 deletions

View File

@ -1,4 +1,4 @@
# Total Freedom Mod v2.7 Configuration # Total Freedom Mod v2.9 Configuration
# by Madgeek1450 # by Madgeek1450
# Block placement prevention: # Block placement prevention:
@ -61,9 +61,17 @@ auto_protect_radius: 25.0
# SuperAwesomeAdmins - Because normal superadmin just isn't awesome enough. These users can do even more awesomey admin shit. # SuperAwesomeAdmins - Because normal superadmin just isn't awesome enough. These users can do even more awesomey admin shit.
super_awesome_admins: super_awesome_admins:
- console
- markbyron - markbyron
- mark - mark
- madgeek1450 - madgeek1450
- madgeek - madgeek
- darthsalamon - darthsalamon
- darth - darth
# Login Title Message Customization - Format: '&b<user_name> is <title_message>', where &b is a color code.
user_titles:
markbyron: the &downer&b.
madgeek1450: the &5chief-developer&b and &6master-ass-kicker&b.
darthsalamon: a &5developer&b!
miwojedk: a &4master-builder&b.

View File

@ -5,8 +5,6 @@ import java.net.InetSocketAddress;
import java.net.URI; import java.net.URI;
import java.util.*; import java.util.*;
import java.util.jar.JarFile; import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
@ -686,24 +684,29 @@ public class TFM_Util
return "an " + ChatColor.YELLOW + ChatColor.UNDERLINE + "impostor" + ChatColor.RESET + ChatColor.AQUA + "!"; return "an " + ChatColor.YELLOW + ChatColor.UNDERLINE + "impostor" + ChatColor.RESET + ChatColor.AQUA + "!";
} }
if (sender.getName().equalsIgnoreCase("markbyron")) // if (sender.getName().equalsIgnoreCase("markbyron"))
{ // {
return "the " + ChatColor.LIGHT_PURPLE + "owner" + ChatColor.AQUA + "."; // return "the " + ChatColor.LIGHT_PURPLE + "owner" + ChatColor.AQUA + ".";
} // }
//
// if (sender.getName().equalsIgnoreCase("madgeek1450"))
// {
// return "the " + ChatColor.DARK_PURPLE + "chief-developer" + ChatColor.AQUA + " and " + ChatColor.GOLD + "master-ass-kicker" + ChatColor.AQUA + ".";
// }
//
// if (sender.getName().equalsIgnoreCase("darthsalamon"))
// {
// return "a " + ChatColor.DARK_PURPLE + "developer" + ChatColor.AQUA + "!";
// }
//
// if (sender.getName().equalsIgnoreCase("miwojedk"))
// {
// return "a " + ChatColor.DARK_RED + "master-builder" + ChatColor.AQUA + "!";
// }
if (sender.getName().equalsIgnoreCase("madgeek1450")) if (TotalFreedomMod.customUserTitles.containsKey(sender.getName().toLowerCase()))
{ {
return "the " + ChatColor.DARK_PURPLE + "chief-developer" + ChatColor.AQUA + " and " + ChatColor.GOLD + "master-ass-kicker" + ChatColor.AQUA + "."; return ChatColor.translateAlternateColorCodes('&', TotalFreedomMod.customUserTitles.get(sender.getName().toLowerCase()));
}
if (sender.getName().equalsIgnoreCase("darthsalamon"))
{
return "a " + ChatColor.DARK_PURPLE + "developer" + ChatColor.AQUA + "!";
}
if (sender.getName().equalsIgnoreCase("miwojedk"))
{
return "a " + ChatColor.DARK_RED + "master-builder" + ChatColor.AQUA + "!";
} }
if (TFM_Util.isUserSuperadmin(sender)) if (TFM_Util.isUserSuperadmin(sender))

View File

@ -3,6 +3,7 @@ package me.StevenLawson.TotalFreedomMod;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.util.*; import java.util.*;
import java.util.Map.Entry;
import me.StevenLawson.TotalFreedomMod.Commands.TFM_Command; import me.StevenLawson.TotalFreedomMod.Commands.TFM_Command;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_BlockListener; import me.StevenLawson.TotalFreedomMod.Listener.TFM_BlockListener;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_EntityListener; import me.StevenLawson.TotalFreedomMod.Listener.TFM_EntityListener;
@ -198,6 +199,7 @@ public class TotalFreedomMod extends JavaPlugin
public static boolean protectedAreasEnabled = true; public static boolean protectedAreasEnabled = true;
public static boolean autoProtectSpawnpoints = true; public static boolean autoProtectSpawnpoints = true;
public static double autoProtectRadius = 25.0D; public static double autoProtectRadius = 25.0D;
public static Map<String, String> customUserTitles = new HashMap<String, String>();
public void loadMainConfig() public void loadMainConfig()
{ {
@ -239,6 +241,17 @@ public class TotalFreedomMod extends JavaPlugin
protectedAreasEnabled = config.getBoolean("protected_areas_enabled", protectedAreasEnabled); protectedAreasEnabled = config.getBoolean("protected_areas_enabled", protectedAreasEnabled);
autoProtectSpawnpoints = config.getBoolean("auto_protect_spawnpoints", autoProtectSpawnpoints); autoProtectSpawnpoints = config.getBoolean("auto_protect_spawnpoints", autoProtectSpawnpoints);
autoProtectRadius = config.getDouble("auto_protect_radius", autoProtectRadius); autoProtectRadius = config.getDouble("auto_protect_radius", autoProtectRadius);
if (config.isConfigurationSection("user_titles"))
{
Map<String, Object> raw_titles = config.getConfigurationSection("user_titles").getValues(false);
Iterator<Entry<String, Object>> it = raw_titles.entrySet().iterator();
while (it.hasNext())
{
Entry<String, Object> pair = it.next();
customUserTitles.put(pair.getKey(), (String) pair.getValue());
}
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -1,6 +1,6 @@
name: TotalFreedomMod name: TotalFreedomMod
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
version: 2.8 version: 2.9
description: Plugin for the Total Freedom server. description: Plugin for the Total Freedom server.
authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon] authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon]
commands: commands: