2014-10-19 23:04:27 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FLocation;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.util.VisualizeUtil;
|
2015-01-22 00:58:33 +01:00
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
|
2014-10-19 23:04:27 +02:00
|
|
|
import org.bukkit.Location;
|
|
|
|
import org.bukkit.Material;
|
|
|
|
import org.bukkit.World;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
public class CmdSeeChunk extends FCommand {
|
|
|
|
|
|
|
|
public CmdSeeChunk() {
|
|
|
|
super();
|
|
|
|
aliases.add("seechunk");
|
|
|
|
aliases.add("sc");
|
|
|
|
|
|
|
|
permission = Permission.SEECHUNK.node;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = false;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void perform() {
|
|
|
|
World world = me.getWorld();
|
|
|
|
FLocation flocation = new FLocation(me);
|
|
|
|
int chunkX = (int) flocation.getX();
|
|
|
|
int chunkZ = (int) flocation.getZ();
|
|
|
|
|
|
|
|
int blockX;
|
|
|
|
int blockZ;
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
blockX = chunkX * 16;
|
|
|
|
blockZ = chunkZ * 16;
|
2014-10-19 23:04:27 +02:00
|
|
|
showPillar(me, world, blockX, blockZ);
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
blockX = chunkX * 16 + 15;
|
|
|
|
blockZ = chunkZ * 16;
|
2014-10-19 23:04:27 +02:00
|
|
|
showPillar(me, world, blockX, blockZ);
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
blockX = chunkX * 16;
|
|
|
|
blockZ = chunkZ * 16 + 15;
|
2014-10-19 23:04:27 +02:00
|
|
|
showPillar(me, world, blockX, blockZ);
|
|
|
|
|
2014-11-06 01:36:47 +01:00
|
|
|
blockX = chunkX * 16 + 15;
|
|
|
|
blockZ = chunkZ * 16 + 15;
|
2014-10-19 23:04:27 +02:00
|
|
|
showPillar(me, world, blockX, blockZ);
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
public static void showPillar(Player player, World world, int blockX, int blockZ) {
|
2014-10-20 19:06:47 +02:00
|
|
|
for (int blockY = 0; blockY < player.getLocation().getBlockY() + 30; blockY++) {
|
2014-10-19 23:04:27 +02:00
|
|
|
Location loc = new Location(world, blockX, blockY, blockZ);
|
2014-11-06 01:36:47 +01:00
|
|
|
if (loc.getBlock().getType() != Material.AIR) {
|
|
|
|
continue;
|
|
|
|
}
|
2014-10-20 19:06:47 +02:00
|
|
|
int typeId = blockY % 5 == 0 ? Material.REDSTONE_LAMP_ON.getId() : Material.STAINED_GLASS.getId();
|
2014-10-19 23:04:27 +02:00
|
|
|
VisualizeUtil.addLocation(player, loc, typeId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-22 00:58:33 +01:00
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.GENERIC_PLACEHOLDER;
|
|
|
|
}
|
|
|
|
|
2014-10-19 23:04:27 +02:00
|
|
|
}
|