Containers can now be accessed by default if undefined & the player is in the same faction as the container being accessed.
This commit is contained in:
@@ -5,6 +5,8 @@ import com.massivecraft.factions.FLocation;
|
||||
import com.massivecraft.factions.Faction;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.util.SpiralTask;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
|
||||
@@ -34,6 +36,15 @@ public class CmdClaim extends FCommand {
|
||||
int radius = this.argAsInt(0, 1); // Default to 1
|
||||
final Faction forFaction = this.argAsFaction(1, myFaction); // Default to own
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = forFaction.getAccess(fme, PermissableAction.TERRITORY);
|
||||
if (access == Access.DENY) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "change faction territory!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (radius < 1) {
|
||||
msg(TL.COMMAND_CLAIM_INVALIDRADIUS);
|
||||
return;
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.massivecraft.factions.integration.Econ;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.struct.Role;
|
||||
import com.massivecraft.factions.util.SpiralTask;
|
||||
import com.massivecraft.factions.zcore.fperms.Access;
|
||||
import com.massivecraft.factions.zcore.fperms.PermissableAction;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
@@ -33,6 +35,16 @@ public class CmdUnclaim extends FCommand {
|
||||
int radius = this.argAsInt(0, 1); // Default to 1
|
||||
final Faction forFaction = this.argAsFaction(1, myFaction); // Default to own
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = forFaction.getAccess(fme, PermissableAction.TERRITORY);
|
||||
if (access == Access.DENY) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "change faction territory!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (radius < 1) {
|
||||
msg(TL.COMMAND_CLAIM_INVALIDRADIUS);
|
||||
return;
|
||||
@@ -117,11 +129,16 @@ public class CmdUnclaim extends FCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (targetFaction.getAccess(fme,PermissableAction.TERRITORY) == Access.DENY) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!assertHasFaction()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!assertMinRole(Role.MODERATOR)) {
|
||||
if (targetFaction.getAccess(fme,PermissableAction.TERRITORY) != Access.ALLOW || !assertMinRole(Role.MODERATOR)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user