mods can check other players skills

This commit is contained in:
Cheese 2015-10-14 14:34:30 +11:00
parent 45cd2a38e1
commit 86bad0be30

View File

@ -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());