Vinetos

OfflinePlayer | Bukkit Dev' (#59)

Jun 15th, 2016
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import org.bukkit.Bukkit;
  2. import org.bukkit.OfflinePlayer;
  3. import org.bukkit.plugin.java.JavaPlugin;
  4.  
  5. import java.text.SimpleDateFormat;
  6. import java.util.Date;
  7. import java.util.UUID;
  8.  
  9. /**
  10.  * The MIT License (MIT)
  11.  * Created on 28/05/2016.
  12.  * Copyright (c) 2016 @author Vinetos
  13.  */
  14. public class Main extends JavaPlugin {
  15.  
  16.     @Override
  17.     public void onEnable() {
  18.         OfflinePlayer op = Bukkit.getOfflinePlayer(UUID.fromString("5610d4eb-bc69-468d-9c4f-c5604d15e35e"));
  19.         SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd/MM/yy HH:mm");
  20.         log(simpleDateFormat.format(new Date(op.getFirstPlayed())));
  21.         log(simpleDateFormat.format(new Date(op.getLastPlayed())));
  22.     }
  23.  
  24.     private void log(String message) {
  25.         System.out.println(message);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment