updata
This commit is contained in:
@ -24,21 +24,26 @@ public class DisplayInfoBlock implements JoinQuitEventBlock {
|
||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||
final Player player = event.getPlayer();
|
||||
final UUID uuid = player.getUniqueId();
|
||||
final String name = player.getDisplayName();
|
||||
|
||||
try {
|
||||
infoHandler = MainPlugin.getPlugin().getServer().getScheduler().scheduleDelayedRepeatingTask(new Task() {
|
||||
@Override
|
||||
public void onRun(int i) {
|
||||
String name = player.getDisplayName();
|
||||
int ping = player.getPing();
|
||||
RePlayer rePlayer = StaticData.rePlayerMap.get(uuid);
|
||||
int coin = rePlayer.getCoin();
|
||||
try {
|
||||
int ping = player.getPing();
|
||||
RePlayer rePlayer = StaticData.rePlayerMap.get(uuid);
|
||||
int coin = rePlayer.getCoin();
|
||||
|
||||
player.sendActionBar(TextFormat.colorize("" + name + " &f延迟: " + ping + "ms 硬币: " + coin));
|
||||
player.sendActionBar(TextFormat.colorize("" + name + " &f延迟: " + ping + "ms 硬币: " + coin));
|
||||
} catch (Exception e) {
|
||||
cancel();
|
||||
}
|
||||
}
|
||||
}, Config.JOIN_WAITING_TIME, 36);
|
||||
} catch (Exception e) {
|
||||
infoHandler.cancel();
|
||||
if (infoHandler != null)
|
||||
infoHandler.cancel();
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user