Testing out the new PSFormat called HumanSpace.
This commit is contained in:
		@@ -9,6 +9,8 @@ import com.massivecraft.factions.Perm;
 | 
				
			|||||||
import com.massivecraft.factions.util.VisualizeUtil;
 | 
					import com.massivecraft.factions.util.VisualizeUtil;
 | 
				
			||||||
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
 | 
					import com.massivecraft.mcore.cmd.req.ReqHasPerm;
 | 
				
			||||||
import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
 | 
					import com.massivecraft.mcore.cmd.req.ReqIsPlayer;
 | 
				
			||||||
 | 
					import com.massivecraft.mcore.ps.PS;
 | 
				
			||||||
 | 
					import com.massivecraft.mcore.ps.PSFormatHumanSpace;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class CmdFactionsSeeChunk extends FCommand
 | 
					public class CmdFactionsSeeChunk extends FCommand
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -24,34 +26,37 @@ public class CmdFactionsSeeChunk extends FCommand
 | 
				
			|||||||
	@Override
 | 
						@Override
 | 
				
			||||||
	public void perform()
 | 
						public void perform()
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		Location meLoc = me.getLocation();
 | 
							// Args
 | 
				
			||||||
		// Which chunk are we standing in ATM?
 | 
							World world = me.getWorld();
 | 
				
			||||||
		// This bit shifting is something like divide by 16 :P
 | 
							PS chunk = PS.valueOf(me).getChunk(true);
 | 
				
			||||||
		int chunkX = meLoc.getBlockX() >> 4;
 | 
							int chunkX = chunk.getChunkX();
 | 
				
			||||||
		int chunkZ = meLoc.getBlockZ() >> 4;
 | 
							int chunkZ = chunk.getChunkZ();
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// Get the pillars for that chunk
 | 
							// Apply
 | 
				
			||||||
		int blockX;
 | 
							int blockX;
 | 
				
			||||||
		int blockZ;
 | 
							int blockZ;
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		blockX = chunkX*16;
 | 
							blockX = chunkX*16;
 | 
				
			||||||
		blockZ = chunkZ*16;
 | 
							blockZ = chunkZ*16;
 | 
				
			||||||
		showPillar(me, me.getWorld(), blockX, blockZ);
 | 
							showPillar(me, world, blockX, blockZ);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		blockX = chunkX*16 + 15;
 | 
							blockX = chunkX*16 + 15;
 | 
				
			||||||
		blockZ = chunkZ*16;
 | 
							blockZ = chunkZ*16;
 | 
				
			||||||
		showPillar(me, me.getWorld(), blockX, blockZ);
 | 
							showPillar(me, world, blockX, blockZ);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		blockX = chunkX*16;
 | 
							blockX = chunkX*16;
 | 
				
			||||||
		blockZ = chunkZ*16 + 15;
 | 
							blockZ = chunkZ*16 + 15;
 | 
				
			||||||
		showPillar(me, me.getWorld(), blockX, blockZ);
 | 
							showPillar(me, world, blockX, blockZ);
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		blockX = chunkX*16 + 15;
 | 
							blockX = chunkX*16 + 15;
 | 
				
			||||||
		blockZ = chunkZ*16 + 15;
 | 
							blockZ = chunkZ*16 + 15;
 | 
				
			||||||
		showPillar(me, me.getWorld(), blockX, blockZ);
 | 
							showPillar(me, world, blockX, blockZ);
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
							// Inform
 | 
				
			||||||
 | 
							msg("<i>Visualized %s", chunk.toString(PSFormatHumanSpace.get()));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	public void showPillar(Player player, World world, int blockX, int blockZ)
 | 
						public static void showPillar(Player player, World world, int blockX, int blockZ)
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		for (int blockY = 0; blockY < world.getMaxHeight(); blockY++)
 | 
							for (int blockY = 0; blockY < world.getMaxHeight(); blockY++)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@ import com.massivecraft.factions.event.FactionsEventMembershipChange.MembershipC
 | 
				
			|||||||
import com.massivecraft.factions.util.RelationUtil;
 | 
					import com.massivecraft.factions.util.RelationUtil;
 | 
				
			||||||
import com.massivecraft.mcore.mixin.Mixin;
 | 
					import com.massivecraft.mcore.mixin.Mixin;
 | 
				
			||||||
import com.massivecraft.mcore.ps.PS;
 | 
					import com.massivecraft.mcore.ps.PS;
 | 
				
			||||||
 | 
					import com.massivecraft.mcore.ps.PSFormatHumanSpace;
 | 
				
			||||||
import com.massivecraft.mcore.store.SenderEntity;
 | 
					import com.massivecraft.mcore.store.SenderEntity;
 | 
				
			||||||
import com.massivecraft.mcore.util.MUtil;
 | 
					import com.massivecraft.mcore.util.MUtil;
 | 
				
			||||||
import com.massivecraft.mcore.util.SenderUtil;
 | 
					import com.massivecraft.mcore.util.SenderUtil;
 | 
				
			||||||
@@ -726,10 +727,11 @@ public class UPlayer extends SenderEntity<UPlayer> implements EconomyParticipato
 | 
				
			|||||||
			informees.add(UPlayer.get(SenderUtil.getConsole()));
 | 
								informees.add(UPlayer.get(SenderUtil.getConsole()));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
 | 
							String chunkString = chunk.toString(PSFormatHumanSpace.get());
 | 
				
			||||||
 | 
							String typeString = event.getType().toString().toLowerCase();
 | 
				
			||||||
		for (UPlayer informee : informees)
 | 
							for (UPlayer informee : informees)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			String chunkString = Txt.parse("<h>%s <h>%d %d", Mixin.getWorldDisplayName(chunk.getWorld()), chunk.getChunkX(), chunk.getChunkZ());
 | 
								informee.msg("<h>%s<i> did %s %s <i>for <h>%s<i> from <h>%s<i>.", this.describeTo(informee, true), typeString, chunkString, newFaction.describeTo(informee), oldFaction.describeTo(informee));
 | 
				
			||||||
			informee.msg("<h>%s<i> did %s %s <i>for <h>%s<i> from <h>%s<i>.", this.describeTo(informee, true), event.getType().toString().toLowerCase(), chunkString, newFaction.describeTo(informee), oldFaction.describeTo(informee));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user