level 25 is uneffected by chat delay

This commit is contained in:
Cheese 2015-06-20 11:18:31 +10:00
parent 2c43dc76c9
commit 77bf332c29
2 changed files with 13 additions and 5 deletions

View File

@ -203,8 +203,8 @@ public class AchievementManager extends MiniPlugin
return true;
}
public String getMineplexLevel(Player sender, Rank rank)
public int getMineplexLevelNumber(Player sender, Rank rank)
{
int level = get(sender, Achievement.GLOBAL_MINEPLEX_LEVEL).getLevel();
@ -219,8 +219,12 @@ public class AchievementManager extends MiniPlugin
else if (rank.Has(Rank.MODERATOR))
level = Math.max(level, 5);
return Achievement.getExperienceString(level) + " " + ChatColor.RESET;
return level;
}
public String getMineplexLevel(Player sender, Rank rank)
{
return Achievement.getExperienceString(getMineplexLevelNumber(sender, rank)) + " " + ChatColor.RESET;
}
public void setShopEnabled(boolean var)

View File

@ -25,6 +25,7 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType;
import mineplex.core.account.CoreClientManager;
import mineplex.core.achievement.AchievementManager;
import mineplex.core.chat.command.BroadcastCommand;
import mineplex.core.chat.command.SilenceCommand;
import mineplex.core.common.Rank;
@ -50,6 +51,7 @@ public class Chat extends MiniPlugin
{
private CoreClientManager _clientManager;
private PreferencesManager _preferences;
private AchievementManager _achievements;
private String _filterUrl = "https://10.33.53.5:8003/content/item/moderate";
private String _appId = "34018d65-466d-4a91-8e92-29ca49f022c4";
@ -62,13 +64,14 @@ public class Chat extends MiniPlugin
private HashMap<UUID, MessageData> _playerLastMessage = new HashMap<UUID, MessageData>();
public Chat(JavaPlugin plugin, CoreClientManager clientManager, PreferencesManager preferences, String serverName)
public Chat(JavaPlugin plugin, CoreClientManager clientManager, PreferencesManager preferences, AchievementManager achievements, String serverName)
{
super("Chat", plugin);
_clientManager = clientManager;
_serverName = serverName;
_preferences = preferences;
_achievements = achievements;
try
{
@ -305,6 +308,7 @@ public class Chat extends MiniPlugin
}
else if (_threeSecondDelay &&
_clientManager.Get(sender).GetRank() == Rank.ALL &&
_achievements.getMineplexLevelNumber(sender, Rank.ALL) < 25 &&
!Recharge.Instance.use(sender, "All Chat Message", 3000, false, false))
{
UtilPlayer.message(sender, C.cYellow + "You can only chat once every 3 seconds to prevent spam.");