fixessss
This commit is contained in:
parent
972a2d151a
commit
0d43ffc7b2
@ -13,7 +13,7 @@ public class AddCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public AddCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "add");
|
||||
super(plugin, Rank.JNR_DEV, "add");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,7 @@ public class DeleteCommand extends CommandBase<NpcManager>
|
||||
{
|
||||
public DeleteCommand(NpcManager plugin)
|
||||
{
|
||||
super(plugin, Rank.DEVELOPER, "del");
|
||||
super(plugin, Rank.JNR_DEV, "del");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -10,7 +10,7 @@ public class NpcCommand extends MultiCommandBase<NpcManager>
|
||||
{
|
||||
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 DeleteCommand(plugin));
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.game.clans.core.repository;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import mineplex.game.clans.core.repository.tokens.ClanTerritoryToken;
|
||||
|
||||
public class ClanTerritory
|
||||
@ -16,4 +18,14 @@ public class ClanTerritory
|
||||
public boolean Safe;
|
||||
public String Owner = "";
|
||||
public String Chunk = "";
|
||||
|
||||
public boolean isSafe(Location location)
|
||||
{
|
||||
if (Owner.equals("Spawn"))
|
||||
{
|
||||
return location.getY() > 190;
|
||||
}
|
||||
|
||||
return Safe;
|
||||
}
|
||||
}
|
||||
|
@ -742,6 +742,6 @@ public class ClansAdmin
|
||||
Clans.getClanDataAccess().safe(claim, caller.getName());
|
||||
|
||||
//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()))));
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ public class ClansUtility
|
||||
{
|
||||
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)
|
||||
@ -439,15 +439,15 @@ public class ClansUtility
|
||||
}
|
||||
|
||||
// Player Territory
|
||||
public ClanRelation relPT(Player pA, String tB)
|
||||
public ClanRelation relPT(Player player, String territory)
|
||||
{
|
||||
ClanTerritory claim = getClaim(tB);
|
||||
if (claim != null && claim.Safe)
|
||||
ClanTerritory claim = getClaim(territory);
|
||||
if (claim != null && claim.isSafe(player.getLocation()))
|
||||
{
|
||||
return ClanRelation.SAFE;
|
||||
}
|
||||
|
||||
return rel(getClanByPlayer(pA), getOwner(tB));
|
||||
return rel(getClanByPlayer(player), getOwner(territory));
|
||||
}
|
||||
|
||||
// Clan Territory
|
||||
|
@ -16,7 +16,7 @@ public class RegionsCommand extends CommandBase<ClansManager>
|
||||
|
||||
public RegionsCommand(ClansManager plugin)
|
||||
{
|
||||
super(plugin, Rank.ADMIN, "region-reset");
|
||||
super(plugin, Rank.ADMIN, new Rank[]{Rank.JNR_DEV},"region-reset");
|
||||
|
||||
_manager = plugin;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ public class ObserverManager extends MiniPlugin
|
||||
{
|
||||
ClanTerritory territory = _clansManager.getClanUtility().getClaim(player.getLocation());
|
||||
|
||||
if (territory == null || !territory.Safe)
|
||||
if (territory == null || !territory.isSafe(player.getLocation()))
|
||||
{
|
||||
if (notify)
|
||||
UtilPlayer.message(player, F.main("Observer", "You must be in a Safe Zone to use observer mode!"));
|
||||
|
@ -39,7 +39,7 @@ import mineplex.minecraft.game.classcombat.Skill.event.SkillTeleportEvent;
|
||||
public class ClansRegions extends MiniPlugin
|
||||
{
|
||||
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 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)
|
||||
|
@ -94,7 +94,7 @@ public class Gameplay extends MiniPlugin
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
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");
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class MagneticMaul extends LegendaryItem
|
||||
Location loc = wielder.getLocation();
|
||||
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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user