This commit is contained in:
NewGarbo 2015-11-26 06:54:49 +00:00
parent 972a2d151a
commit 0d43ffc7b2
11 changed files with 26 additions and 14 deletions

View File

@ -13,7 +13,7 @@ public class AddCommand extends CommandBase<NpcManager>
{ {
public AddCommand(NpcManager plugin) public AddCommand(NpcManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "add"); super(plugin, Rank.JNR_DEV, "add");
} }
@Override @Override

View File

@ -12,7 +12,7 @@ public class DeleteCommand extends CommandBase<NpcManager>
{ {
public DeleteCommand(NpcManager plugin) public DeleteCommand(NpcManager plugin)
{ {
super(plugin, Rank.DEVELOPER, "del"); super(plugin, Rank.JNR_DEV, "del");
} }
@Override @Override

View File

@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
{ {
public NpcCommand(NpcManager plugin) public NpcCommand(NpcManager plugin)
{ {
super(plugin, Rank.DEVELOPER, new Rank[] {Rank.JNR_DEV}, "npc"); super(plugin, Rank.JNR_DEV, "npc");
AddCommand(new AddCommand(plugin)); AddCommand(new AddCommand(plugin));
AddCommand(new DeleteCommand(plugin)); AddCommand(new DeleteCommand(plugin));

View File

@ -1,5 +1,7 @@
package mineplex.game.clans.core.repository; package mineplex.game.clans.core.repository;
import org.bukkit.Location;
import mineplex.game.clans.core.repository.tokens.ClanTerritoryToken; import mineplex.game.clans.core.repository.tokens.ClanTerritoryToken;
public class ClanTerritory public class ClanTerritory
@ -16,4 +18,14 @@ public class ClanTerritory
public boolean Safe; public boolean Safe;
public String Owner = ""; public String Owner = "";
public String Chunk = ""; public String Chunk = "";
public boolean isSafe(Location location)
{
if (Owner.equals("Spawn"))
{
return location.getY() > 190;
}
return Safe;
}
} }

View File

@ -742,6 +742,6 @@ public class ClansAdmin
Clans.getClanDataAccess().safe(claim, caller.getName()); Clans.getClanDataAccess().safe(claim, caller.getName());
//Inform //Inform
UtilPlayer.message(caller, F.main("Clans Admin", "Territory Safe Zone: " + F.tf(claim.Safe))); UtilPlayer.message(caller, F.main("Clans Admin", "Territory Safe Zone: " + F.tf(claim.isSafe(caller.getLocation()))));
} }
} }

View File

@ -246,7 +246,7 @@ public class ClansUtility
{ {
if (!Clans.getClaimMap().containsKey(UtilWorld.chunkToStr(loc.getChunk()))) return false; if (!Clans.getClaimMap().containsKey(UtilWorld.chunkToStr(loc.getChunk()))) return false;
return Clans.getClaimMap().get(UtilWorld.chunkToStr(loc.getChunk())).Safe; return Clans.getClaimMap().get(UtilWorld.chunkToStr(loc.getChunk())).isSafe(loc);
} }
public boolean isChunkHome(ClanInfo clan, Chunk chunk) public boolean isChunkHome(ClanInfo clan, Chunk chunk)
@ -439,15 +439,15 @@ public class ClansUtility
} }
// Player Territory // Player Territory
public ClanRelation relPT(Player pA, String tB) public ClanRelation relPT(Player player, String territory)
{ {
ClanTerritory claim = getClaim(tB); ClanTerritory claim = getClaim(territory);
if (claim != null && claim.Safe) if (claim != null && claim.isSafe(player.getLocation()))
{ {
return ClanRelation.SAFE; return ClanRelation.SAFE;
} }
return rel(getClanByPlayer(pA), getOwner(tB)); return rel(getClanByPlayer(player), getOwner(territory));
} }
// Clan Territory // Clan Territory

View File

@ -16,7 +16,7 @@ public class RegionsCommand extends CommandBase<ClansManager>
public RegionsCommand(ClansManager plugin) public RegionsCommand(ClansManager plugin)
{ {
super(plugin, Rank.ADMIN, "region-reset"); super(plugin, Rank.ADMIN, new Rank[]{Rank.JNR_DEV},"region-reset");
_manager = plugin; _manager = plugin;
} }

View File

@ -155,7 +155,7 @@ public class ObserverManager extends MiniPlugin
{ {
ClanTerritory territory = _clansManager.getClanUtility().getClaim(player.getLocation()); ClanTerritory territory = _clansManager.getClanUtility().getClaim(player.getLocation());
if (territory == null || !territory.Safe) if (territory == null || !territory.isSafe(player.getLocation()))
{ {
if (notify) if (notify)
UtilPlayer.message(player, F.main("Observer", "You must be in a Safe Zone to use observer mode!")); UtilPlayer.message(player, F.main("Observer", "You must be in a Safe Zone to use observer mode!"));

View File

@ -39,7 +39,7 @@ import mineplex.minecraft.game.classcombat.Skill.event.SkillTeleportEvent;
public class ClansRegions extends MiniPlugin public class ClansRegions extends MiniPlugin
{ {
public final static String DEFAULT_WORLD_NAME = "world"; public final static String DEFAULT_WORLD_NAME = "world";
public final static int SPAWN_RADIUS = 3; // Radius of spawn claim area (measured in chunks) public final static int SPAWN_RADIUS = 2; // Radius of spawn claim area (measured in chunks)
public final static int SHOP_RADIUS = 4; // Radius of shop claim area (measured in chunks) public final static int SHOP_RADIUS = 4; // Radius of shop claim area (measured in chunks)
public final static int FIELDS_RADIUS = 7; // Radius of fields claim area (measured in chunks) public final static int FIELDS_RADIUS = 7; // Radius of fields claim area (measured in chunks)
public final static int BORDERLANDS_RADIUS = 50; // Radius of borderlands claim area (measured in chunks) public final static int BORDERLANDS_RADIUS = 50; // Radius of borderlands claim area (measured in chunks)

View File

@ -94,7 +94,7 @@ public class Gameplay extends MiniPlugin
@EventHandler(priority = EventPriority.LOWEST) @EventHandler(priority = EventPriority.LOWEST)
public void spawnDamage(CustomDamageEvent event) public void spawnDamage(CustomDamageEvent event)
{ {
if (_clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()) != null && _clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()).Safe) if (_clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()) != null && _clansManager.getClanUtility().getClaim(event.GetDamageeEntity().getLocation()).isSafe(event.GetDamageeEntity().getLocation()))
{ {
event.SetCancelled("Safe Zone"); event.SetCancelled("Safe Zone");
} }

View File

@ -27,7 +27,7 @@ public class MagneticMaul extends LegendaryItem
Location loc = wielder.getLocation(); Location loc = wielder.getLocation();
if (ClansManager.getInstance().getClaimMap().containsKey(UtilWorld.chunkToStr(loc.getChunk()))) if (ClansManager.getInstance().getClaimMap().containsKey(UtilWorld.chunkToStr(loc.getChunk())))
{ {
if (!ClansManager.getInstance().getClaimMap().get(UtilWorld.chunkToStr(loc.getChunk())).Safe) if (!ClansManager.getInstance().getClaimMap().get(UtilWorld.chunkToStr(loc.getChunk())).isSafe(wielder.getLocation()))
{ {
return; return;
} }