Chat filter clan names, Fix scoreboard bug

This commit is contained in:
Shaun Bennett 2015-06-23 22:48:51 -05:00
parent 935aba9c16
commit fa612c9c86
4 changed files with 17 additions and 4 deletions

View File

@ -147,7 +147,7 @@ public class PlayerScoreboard
_scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
//Side Obj
_sideObjective = _scoreboard.registerNewObjective(player.getName() + UtilMath.r(999999999), "dummy");
_sideObjective = _scoreboard.registerNewObjective("side", "dummy");
_sideObjective.setDisplaySlot(DisplaySlot.SIDEBAR);
_sideObjective.setDisplayName(C.Bold + " MINEPLEX ");

View File

@ -100,7 +100,7 @@ public class Clans extends JavaPlugin
new FriendManager(this, _clientManager, preferenceManager, portal);
new InventoryManager(this, _clientManager);
_clansManager = new ClansManager(this, serverStatusManager.getCurrentServerName(), _clientManager, _donationManager, blockRestore, teleport, webServerAddress);
_clansManager = new ClansManager(this, serverStatusManager.getCurrentServerName(), _clientManager, _donationManager, blockRestore, teleport, chat, webServerAddress);
new Recipes(this);
new Farming(this);
new BuildingShop(_clansManager, _clientManager, _donationManager);

View File

@ -19,6 +19,7 @@ import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.chat.Chat;
import mineplex.core.common.util.C;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.common.util.UtilPlayer;
@ -93,6 +94,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
private WarManager _warManager;
private ProjectileManager _projectileManager;
private WorldEventManager _worldEvent;
private Chat _chat;
private int _inviteExpire = 2;
private int _nameMin = 3;
@ -111,7 +113,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
public String[] denyClan = new String[] {
"neut", "neutral", "sethome", "promote", "demote", "admin", "help", "create", "disband", "delete", "invite", "join", "kick", "ally", "trust", "claim", "unclaim", "territory", "home"};
public ClansManager(JavaPlugin plugin, String serverName, CoreClientManager clientManager, DonationManager donationManager, BlockRestore blockRestore, Teleport teleport, String webServerAddress)
public ClansManager(JavaPlugin plugin, String serverName, CoreClientManager clientManager, DonationManager donationManager, BlockRestore blockRestore, Teleport teleport, Chat chat, String webServerAddress)
{
super("Clans Manager", plugin);
@ -119,7 +121,7 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
_clientManager = clientManager;
_combatManager = new CombatManager(plugin);
_chat = chat;
_blockRestore = blockRestore;
_teleport = teleport;
@ -570,6 +572,11 @@ public class ClansManager extends MiniClientPlugin<ClientClan> implements IRelat
return _worldEvent;
}
public Chat getChat()
{
return _chat;
}
public int convertGoldToEnergy(int gold)
{
return gold * 4;

View File

@ -263,6 +263,12 @@ public class ClansCommand extends CommandBase<ClansManager>
return;
}
if (Plugin.getChat().getFilteredMessage(caller, args[1]).contains("*"))
{
UtilPlayer.message(caller, F.main("Clans", "Clan name inappropriate. Please try a different name"));
return;
}
for (String cur : Plugin.denyClan)
{
if (cur.equalsIgnoreCase(args[1]))