mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 08:25:12 +00:00
Round TPS instead of flooring
This commit is contained in:
parent
ae97ecacd1
commit
ef4d2c46d8
2 changed files with 1 additions and 7 deletions
|
@ -1,9 +1,7 @@
|
||||||
package me.StevenLawson.TotalFreedomMod.discord.commands;
|
package me.StevenLawson.TotalFreedomMod.discord.commands;
|
||||||
|
|
||||||
import com.earth2me.essentials.utils.DateUtil;
|
|
||||||
import me.StevenLawson.TotalFreedomMod.Server;
|
import me.StevenLawson.TotalFreedomMod.Server;
|
||||||
import me.StevenLawson.TotalFreedomMod.discord.command.ExecutableDiscordCommand;
|
import me.StevenLawson.TotalFreedomMod.discord.command.ExecutableDiscordCommand;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.javacord.api.entity.message.MessageBuilder;
|
import org.javacord.api.entity.message.MessageBuilder;
|
||||||
import org.javacord.api.entity.message.embed.EmbedBuilder;
|
import org.javacord.api.entity.message.embed.EmbedBuilder;
|
||||||
import org.javacord.api.entity.user.User;
|
import org.javacord.api.entity.user.User;
|
||||||
|
@ -19,7 +17,7 @@ public class TPSCommand extends ExecutableDiscordCommand {
|
||||||
public MessageBuilder execute(User user, List<String> args) {
|
public MessageBuilder execute(User user, List<String> args) {
|
||||||
EmbedBuilder builder = new EmbedBuilder();
|
EmbedBuilder builder = new EmbedBuilder();
|
||||||
builder.setTitle("Server lag information");
|
builder.setTitle("Server lag information");
|
||||||
builder.addField("TPS", String.valueOf(Math.floor(Server.getTPS())));
|
builder.addField("TPS", String.valueOf(Math.round(Server.getTPS())));
|
||||||
builder.addField("Uptime", Server.getUptime());
|
builder.addField("Uptime", Server.getUptime());
|
||||||
builder.addField("Maximum Memory", String.format("%s MB", Math.ceil(Server.getMaxMem())));
|
builder.addField("Maximum Memory", String.format("%s MB", Math.ceil(Server.getMaxMem())));
|
||||||
builder.addField("Allocated Memory", String.format("%s MB", Math.floor(Server.getTotalMem())));
|
builder.addField("Allocated Memory", String.format("%s MB", Math.floor(Server.getTotalMem())));
|
||||||
|
|
|
@ -9,11 +9,7 @@ import org.javacord.api.entity.user.User;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class UptimeCommand extends ExecutableDiscordCommand {
|
public class UptimeCommand extends ExecutableDiscordCommand {
|
||||||
public UptimeCommand(String command, String description, String category, boolean isAdmin) {
|
public UptimeCommand(String command, String description, String category, boolean isAdmin) {
|
||||||
|
|
Loading…
Reference in a new issue