Merge remote-tracking branch 'origin/master' into monster-maze
This commit is contained in:
commit
41511dce7b
@ -61,17 +61,24 @@ public class BotSpamManager extends MiniPlugin
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onChat(AsyncPlayerChatEvent event)
|
||||
public void onChat(final AsyncPlayerChatEvent event)
|
||||
{
|
||||
// Ignore messages sent by staff members
|
||||
if (_clientManager.hasRank(event.getPlayer(), Rank.HELPER))
|
||||
return;
|
||||
|
||||
for (SpamText spamText : _spam)
|
||||
for (final SpamText spamText : _spam)
|
||||
{
|
||||
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);
|
||||
return;
|
||||
}
|
||||
|
@ -13,12 +13,15 @@ import mineplex.minecraft.game.classcombat.item.ItemFactory;
|
||||
import mineplex.core.MiniClientPlugin;
|
||||
import mineplex.core.account.CoreClientManager;
|
||||
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.updater.event.UpdateEvent;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@ -303,12 +306,30 @@ public class ClassManager extends MiniClientPlugin<ClientClass> implements IClas
|
||||
if (!_enabled)
|
||||
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)
|
||||
event.getPlayer().sendMessage("You do not have a ClientClass.");
|
||||
event.getPlayer().sendMessage(target.getName() + " does not have a ClientClass.");
|
||||
else
|
||||
{
|
||||
client.DisplaySkills(event.getPlayer());
|
||||
|
Loading…
Reference in New Issue
Block a user