From a1e59edce0f2ceb64e067575a3a1b7fbcf79bcd4 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Sat, 12 Oct 2019 13:25:33 +0200 Subject: [PATCH] Show fewer chunk coords. Fixes #49 --- .../factions/cmd/CmdFactionsAccessAbstract.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java index ba58a6f6..a2a603bd 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccessAbstract.java @@ -5,6 +5,7 @@ import com.massivecraft.factions.entity.BoardColl; import com.massivecraft.factions.entity.Faction; import com.massivecraft.factions.entity.MPerm; import com.massivecraft.factions.entity.MPerm.MPermable; +import com.massivecraft.factions.util.AsciiMap; import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer; import com.massivecraft.massivecore.ps.PS; import com.massivecraft.massivecore.ps.PSFormatHumanSpace; @@ -58,7 +59,8 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand public void sendAccessInfo() { - Object title = "Access at " + chunk.toString(PSFormatHumanSpace.get()); + String chunkDesc = AsciiMap.showChunkCoords(chunk) ? " at " + chunk.toString(PSFormatHumanSpace.get()) : ""; + Object title = "Access" + chunkDesc; title = Txt.titleize(title); message(title); @@ -77,26 +79,27 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand TerritoryAccess ta = BoardColl.get().getTerritoryAccessAt(chunk); Faction faction = ta.getHostFaction(); - String chunkDesc = chunk.toString(PSFormatHumanSpace.get()); + + String chunkDesc = AsciiMap.showChunkCoords(chunk) ? " at " + chunk.toString(PSFormatHumanSpace.get()) : ""; String grantedDenied = granted ? "granted" : "denied"; String mpermableDesc = mpermable.getDisplayName(msender); if ( ! MPerm.getPermAccess().has(msender, faction, false)) { - msg("You do not have permission to edit access at %s.", chunkDesc); + msg("You do not have permission to edit access%s.", chunkDesc); return; } if (ta.isGranted(mpermable) == granted) { - msg("Access at %s is already %s to %s.", chunkDesc, grantedDenied, mpermableDesc); + msg("Access%s is already %s to %s.", chunkDesc, grantedDenied, mpermableDesc); return; } ta = ta.withGranted(mpermable, granted); BoardColl.get().setTerritoryAccessAt(chunk, ta); - msg("Access at %s is now %s to %s.", chunkDesc, grantedDenied, mpermableDesc); + msg("Access%s is now %s to %s.", chunkDesc, grantedDenied, mpermableDesc); } }