Merge remote-tracking branch 'origin/master' into monster-maze

This commit is contained in:
Mysticate 2015-10-15 21:19:24 -04:00
commit 41511dce7b
2 changed files with 34 additions and 6 deletions

View File

@ -61,17 +61,24 @@ public class BotSpamManager extends MiniPlugin
} }
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void onChat(AsyncPlayerChatEvent event) public void onChat(final AsyncPlayerChatEvent event)
{ {
// Ignore messages sent by staff members // Ignore messages sent by staff members
if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER)) if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER))
return; return;
for (SpamText spamText : _spam) for (final SpamText spamText : _spam)
{ {
if (spamText.isEnabled() && spamText.isSpam(event.getMessage())) if (spamText.isEnabled() && spamText.isSpam(event.getMessage()))
{ {
punishBot(event.getPlayer(), spamText); runSync(new Runnable()
{
@Override
public void run()
{
punishBot(event.getPlayer(), spamText);
}
});
event.setCancelled(true); event.setCancelled(true);
return; return;
} }

View File

@ -13,12 +13,15 @@ import mineplex.minecraft.game.classcombat.item.ItemFactory;
import mineplex.core.MiniClientPlugin; import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.account.event.ClientWebResponseEvent; import mineplex.core.account.event.ClientWebResponseEvent;
import mineplex.core.common.Rank;
import mineplex.core.common.util.UtilPlayer;
import mineplex.core.donation.DonationManager; import mineplex.core.donation.DonationManager;
import mineplex.core.updater.event.UpdateEvent; import mineplex.core.updater.event.UpdateEvent;
import mineplex.core.updater.UpdateType; import mineplex.core.updater.UpdateType;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson; import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
@ -303,12 +306,30 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
if (!_enabled) if (!_enabled)
return; return;
if (event.getMessage().equals("/skill")) if (event.getMessage().length() < 1)
return;
String[] args = event.getMessage().toLowerCase().split(" ");
if (args[0].equals("/skill"))
{ {
ClientClass client = Get(event.getPlayer().getName()); Player target = event.getPlayer();
//Target Other
if (args.length > 1 && _clientManager.Get(event.getPlayer()).GetRank().has(Rank.MODERATOR))
{
target = UtilPlayer.searchOnline(event.getPlayer(), args[1], true);
if (target == null)
{
return;
}
}
ClientClass client = Get(target.getName());
if (client == null) if (client == null)
event.getPlayer().sendMessage("You do not have a ClientClass."); event.getPlayer().sendMessage(target.getName() + " does not have a ClientClass.");
else else
{ {
client.DisplaySkills(event.getPlayer()); client.DisplaySkills(event.getPlayer());