forked from SteamWar/SteamWar
33 lines
1.1 KiB
Java
33 lines
1.1 KiB
Java
package de.steamwar.lobby.jumpandrun;
|
|
|
|
import de.steamwar.command.SWCommand;
|
|
import de.steamwar.linkage.Linked;
|
|
import de.steamwar.lobby.LobbySystem;
|
|
import de.steamwar.sql.UserConfig;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Locale;
|
|
|
|
@Linked
|
|
public class JumpAndRunCommand extends SWCommand {
|
|
|
|
public JumpAndRunCommand() {
|
|
super("jumpandrun");
|
|
}
|
|
|
|
@Register
|
|
public void genericCommand(Player player, String... args) {
|
|
String time = UserConfig.getConfig(player.getUniqueId(), JumpAndRun.JUMP_AND_RUN_CONFIG);
|
|
if (time == null) {
|
|
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_PERSONAL_BEST_NO_TIME", player);
|
|
return;
|
|
}
|
|
long timeLong = Long.parseLong(time);
|
|
SimpleDateFormat format = new SimpleDateFormat(LobbySystem.getMessage().parse("JUMP_AND_RUN_TIME", player), Locale.ROOT);
|
|
String parsed = format.format(new Date(timeLong));
|
|
LobbySystem.getMessage().sendPrefixless("JUMP_AND_RUN_PERSONAL_BEST_TIME", player, parsed);
|
|
}
|
|
}
|