Update territory display to show raid world and prevent autoclaiming in nether or raid worlds

This commit is contained in:
AlexTheCoder 2017-06-13 23:17:28 -04:00
parent 6ef6abcd72
commit bc61bdff5e
2 changed files with 14 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
import mineplex.core.Managers;
import mineplex.core.MiniPlugin;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
@ -20,6 +21,8 @@ import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.game.clans.clans.ClansUtility.ClanRelation;
import mineplex.game.clans.clans.event.PlayerEnterTerritoryEvent;
import mineplex.game.clans.clans.nether.NetherManager;
import mineplex.game.clans.clans.worldevent.WorldEventManager;
import mineplex.game.clans.core.repository.ClanTerritory;
public class ClansDisplay extends MiniPlugin
@ -56,7 +59,7 @@ public class ClansDisplay extends MiniPlugin
client.setTerritory(UtilWorld.chunkToStr(player.getLocation().getChunk()));
// AutoClaim
if (client.isAutoClaim()) _clansManager.getClanAdmin().claim(player);
if (client.isAutoClaim() && !(Managers.get(NetherManager.class).isInNether(player) || Managers.get(WorldEventManager.class).getRaidManager().isInRaid(player.getLocation()))) _clansManager.getClanAdmin().claim(player);
// Map
String owner = "Wilderness";
@ -127,6 +130,11 @@ public class ClansDisplay extends MiniPlugin
}
}
if (_clansManager.getWorldEvent().getRaidManager().isInRaid(player.getLocation()))
{
ownerString = C.cDRed + "Raid World";
}
// if (_clansManager.getNetherManager().isInNether(player))
// {
// _clansManager.message(player, "You are not allowed to claim territory in " + F.clansNether("The Nether") + ".");

View File

@ -58,6 +58,11 @@ public class ScoreboardElementPlayer implements ScoreboardElement
}
}
if (_clansManager.getWorldEvent().getRaidManager().isInRaid(player.getLocation()))
{
regionString = C.cDRed + "Raid World";
}
output.add(regionString);
return output;