Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private int cycle = 0;
  2. public void tick(){
  3. switch(cycle) {
  4. case 30 * Miscellaneous.MINUTES:
  5. // Run garbage collection
  6. System.gc();
  7. cycle = 0;
  8. break;
  9. default:
  10. cycle++;
  11. break;
  12. }
  13. for(Player player : players) {
  14. if(player == null) {
  15. continue;
  16. }
  17. // process events here (cycles every 500ms)
  18. player.process();
  19. }
  20. // XXX process NPCs
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement