Don't show coords based on gamerule
This commit is contained in:
parent
ecbb4c1a43
commit
fe7bd41455
@ -1,5 +1,6 @@
|
|||||||
package com.massivecraft.factions.cmd;
|
package com.massivecraft.factions.cmd;
|
||||||
|
|
||||||
|
import com.massivecraft.factions.util.AsciiMap;
|
||||||
import com.massivecraft.factions.util.VisualizeUtil;
|
import com.massivecraft.factions.util.VisualizeUtil;
|
||||||
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
import com.massivecraft.massivecore.command.requirement.RequirementIsPlayer;
|
||||||
import com.massivecraft.massivecore.ps.PS;
|
import com.massivecraft.massivecore.ps.PS;
|
||||||
@ -58,7 +59,9 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
|
|||||||
showPillar(me, world, blockX, blockZ);
|
showPillar(me, world, blockX, blockZ);
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
msg("<i>Visualized %s", chunk.toString(PSFormatHumanSpace.get()));
|
boolean showCoords = AsciiMap.showChunkCoords(chunk);
|
||||||
|
String chunkDesc = showCoords ? chunk.toString(PSFormatHumanSpace.get()) : "chunk";
|
||||||
|
msg("<i>Visualized %s", chunkDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showPillar(Player player, World world, int blockX, int blockZ)
|
public static void showPillar(Player player, World world, int blockX, int blockZ)
|
||||||
|
@ -12,6 +12,7 @@ import com.massivecraft.factions.event.EventFactionsDisband;
|
|||||||
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange;
|
||||||
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
import com.massivecraft.factions.event.EventFactionsMembershipChange.MembershipChangeReason;
|
||||||
import com.massivecraft.factions.mixin.PowerMixin;
|
import com.massivecraft.factions.mixin.PowerMixin;
|
||||||
|
import com.massivecraft.factions.util.AsciiMap;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.massivecore.mixin.MixinSenderPs;
|
import com.massivecraft.massivecore.mixin.MixinSenderPs;
|
||||||
import com.massivecraft.massivecore.mixin.MixinTitle;
|
import com.massivecraft.massivecore.mixin.MixinTitle;
|
||||||
@ -847,6 +848,12 @@ public class MPlayer extends SenderEntity<MPlayer> implements FactionsParticipat
|
|||||||
String chunkString = oldChunk.toString(PSFormatHumanSpace.get());
|
String chunkString = oldChunk.toString(PSFormatHumanSpace.get());
|
||||||
String typeString = type.past;
|
String typeString = type.past;
|
||||||
|
|
||||||
|
if (!AsciiMap.showChunkCoords(oldChunk))
|
||||||
|
{
|
||||||
|
chunkString = "";
|
||||||
|
formatMany = formatMany.replace(" near ", "");
|
||||||
|
}
|
||||||
|
|
||||||
for (MPlayer informee : informees)
|
for (MPlayer informee : informees)
|
||||||
{
|
{
|
||||||
informee.msg((oldChunks.size() == 1 ? formatOne : formatMany), this.describeTo(informee, true), typeString, oldChunks.size(), chunkString);
|
informee.msg((oldChunks.size() == 1 ? formatOne : formatMany), this.describeTo(informee, true), typeString, oldChunks.size(), chunkString);
|
||||||
|
@ -10,6 +10,7 @@ import com.massivecraft.massivecore.ps.PS;
|
|||||||
import com.massivecraft.massivecore.util.Txt;
|
import com.massivecraft.massivecore.util.Txt;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameRule;
|
import org.bukkit.GameRule;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -125,8 +126,7 @@ public class AsciiMap
|
|||||||
int chunkZ = chunk.getChunkZ();
|
int chunkZ = chunk.getChunkZ();
|
||||||
String factionName = faction.getName(this.getRelationParticipator());
|
String factionName = faction.getName(this.getRelationParticipator());
|
||||||
|
|
||||||
Boolean reduced = chunk.asBukkitWorld().getGameRuleValue(GameRule.REDUCED_DEBUG_INFO);
|
boolean showCoords = showChunkCoords(chunk);
|
||||||
boolean showCoords = !reduced;
|
|
||||||
|
|
||||||
String title;
|
String title;
|
||||||
if (showCoords) title = String.format(TITLE_FORMAT, chunkX, chunkZ, factionName);
|
if (showCoords) title = String.format(TITLE_FORMAT, chunkX, chunkZ, factionName);
|
||||||
@ -227,4 +227,14 @@ public class AsciiMap
|
|||||||
return Mson.implode(ret, SPACE);
|
return Mson.implode(ret, SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean showChunkCoords(PS chunk)
|
||||||
|
{
|
||||||
|
return showChunkCoords(chunk.asBukkitWorld(true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean showChunkCoords(World w)
|
||||||
|
{
|
||||||
|
return ! w.getGameRuleValue(GameRule.REDUCED_DEBUG_INFO);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user