mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 09:08:01 +01:00
Fix baltop not working in command blocks (#5078)
This commit is contained in:
parent
0be056b9c2
commit
bdc5f4c830
@ -7,6 +7,7 @@ import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.essentialsx.api.v2.services.BalanceTop;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.BlockCommandSender;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DateFormat;
|
||||
@ -32,8 +33,15 @@ public class Commandbalancetop extends EssentialsCommand {
|
||||
final Calendar cal = Calendar.getInstance();
|
||||
cal.setTimeInMillis(ess.getBalanceTop().getCacheAge());
|
||||
final DateFormat format = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
|
||||
sender.sendMessage(tl("balanceTop", format.format(cal.getTime())));
|
||||
new TextPager(cache).showPage(Integer.toString(page), null, "balancetop", sender);
|
||||
final Runnable runnable = () -> {
|
||||
sender.sendMessage(tl("balanceTop", format.format(cal.getTime())));
|
||||
new TextPager(cache).showPage(Integer.toString(page), null, "balancetop", sender);
|
||||
};
|
||||
if (sender.getSender() instanceof BlockCommandSender) {
|
||||
ess.scheduleSyncDelayedTask(runnable);
|
||||
} else {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user