Stacker/Party exceptions for YouTubers

This commit is contained in:
Chiss 2013-11-07 10:33:39 +11:00
parent 9f11352f10
commit 0d5b174ebe
2 changed files with 22 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.util.Vector;
import mineplex.core.MiniPlugin;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
@ -180,6 +181,16 @@ public class StackerManager extends MiniPlugin implements IThrown
return;
}
//YouTuber
if (stackee instanceof Player && Manager.GetClients().Get((Player)stackee).GetRank() == Rank.YOUTUBE)
{
if (!Manager.GetClients().Get(stacker).GetRank().Has(Rank.YOUTUBE))
{
UtilPlayer.message(stacker, F.main("Stacker", F.name(UtilEnt.getName(stackee)) + " cannot be stacked! Leave him/her alone!"));
return;
}
}
if (stackee instanceof LivingEntity)
{
if (((LivingEntity)stackee).isCustomNameVisible())

View File

@ -6,6 +6,7 @@ import org.bukkit.entity.Player;
import mineplex.core.command.CommandBase;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilPlayer;
import mineplex.hub.party.Party;
import mineplex.hub.party.PartyManager;
@ -89,6 +90,16 @@ public class PartyCommand extends CommandBase<PartyManager>
return;
}
//YouTuber
if (Plugin.GetClients().Get(target).GetRank() == Rank.YOUTUBE)
{
if (Plugin.GetClients().Get(caller).GetRank().Has(Rank.YOUTUBE))
{
UtilPlayer.message(caller, F.main("Stacker", "You may not party with " + F.name(UtilEnt.getName(target)) + "! Leave him/her alone!"));
return;
}
}
//Invite or Suggest
if (party != null)
{