geforkt von SteamWar/BungeeCore
Rework
Dieser Commit ist enthalten in:
Ursprung
87db052478
Commit
7220051c18
@ -23,8 +23,11 @@ import de.steamwar.bungeecore.Message;
|
||||
import de.steamwar.bungeecore.sql.SteamwarUser;
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import org.apache.commons.lang3.LocaleUtils;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
public class PlaytimeCommand extends BasicCommand{
|
||||
|
||||
@ -37,9 +40,10 @@ public class PlaytimeCommand extends BasicCommand{
|
||||
if(!(sender instanceof ProxiedPlayer))
|
||||
return;
|
||||
|
||||
String s = Message.parse("DECIMAL_FORMAT", sender);
|
||||
String format = new DecimalFormat(s).format((SteamwarUser.get((ProxiedPlayer) sender).getOnlinetime() / (double) 3600));
|
||||
NumberFormat format = NumberFormat.getNumberInstance(LocaleUtils.toLocale(Message.parse("DECIMAL_FORMAT", sender)));
|
||||
format.setMaximumFractionDigits(2);
|
||||
String formattedText = format.format((SteamwarUser.get((ProxiedPlayer) sender).getOnlinetime() / (double) 3600));
|
||||
|
||||
Message.send(Message.parse("HOURS_PLAYED", sender) + format,sender);
|
||||
Message.send(Message.parse("HOURS_PLAYED", sender) + formattedText,sender);
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren