Saber-Factions/src/main/java/com/massivecraft/factions/cmd/CmdCoords.java

42 lines
1.3 KiB
Java
Raw Normal View History

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() {
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() {
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()) {
fPlayer.sendMessage(message);
}
}
@Override
public TL getUsageTranslation() {
return TL.COMMAND_COORDS_DESCRIPTION;
}
}