2018-04-18 03:01:53 +02:00
|
|
|
package com.massivecraft.factions.cmd;
|
|
|
|
|
|
|
|
import com.massivecraft.factions.FPlayer;
|
|
|
|
import com.massivecraft.factions.struct.Permission;
|
|
|
|
import com.massivecraft.factions.zcore.util.TL;
|
|
|
|
import org.bukkit.Location;
|
|
|
|
|
|
|
|
public class CmdCoords extends FCommand {
|
|
|
|
|
2018-07-12 18:11:07 +02:00
|
|
|
public CmdCoords() {
|
2018-04-18 03:01:53 +02:00
|
|
|
super();
|
|
|
|
this.aliases.add("coords");
|
|
|
|
this.aliases.add("coord");
|
|
|
|
|
|
|
|
this.permission = Permission.COORD.node;
|
|
|
|
this.disableOnLock = true;
|
|
|
|
|
|
|
|
senderMustBePlayer = true;
|
|
|
|
senderMustBeMember = true;
|
|
|
|
senderMustBeModerator = false;
|
|
|
|
senderMustBeColeader = false;
|
|
|
|
senderMustBeAdmin = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-07-12 18:11:07 +02:00
|
|
|
public void perform() {
|
2018-04-18 03:01:53 +02:00
|
|
|
Location location = fme.getPlayer().getLocation();
|
2018-07-12 18:11:07 +02:00
|
|
|
String message = TL.COMMAND_COORDS_MESSAGE.toString().replace("{player}", fme.getPlayer().getDisplayName()).replace("{x}", (int) location.getX() + "")
|
|
|
|
.replace("{y}", (int) location.getY() + "").replace("{z}", (int) location.getZ() + "").replace("{world}", location.getWorld().getName());
|
|
|
|
for (FPlayer fPlayer : fme.getFaction().getFPlayers()) {
|
2018-04-18 03:01:53 +02:00
|
|
|
fPlayer.sendMessage(message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public TL getUsageTranslation() {
|
|
|
|
return TL.COMMAND_COORDS_DESCRIPTION;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|