mrkirby153

Untitled

May 6th, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.95 KB | None | 0 0
  1.     @SubscribeEvent
  2.     public void onServerTick(TickEvent.ServerTickEvent event) {
  3.         Iterator<ActiveVote> voteIterator = activeVotes.iterator();
  4.         while (voteIterator.hasNext()) {
  5.             ActiveVote v = voteIterator.next();
  6.             v.update();
  7.             if (v.toDelete()) {
  8.                 voteIterator.remove();
  9.             }
  10.         }
  11.         // Tick cooldown
  12.         Iterator<Condition> typeIterator = typeCooldown.keySet().iterator();
  13.         while (typeIterator.hasNext()) {
  14.             Condition c = typeIterator.next();
  15.             int time = typeCooldown.get(c);
  16.             if (time - 1 > 0)
  17.                 typeCooldown.put(c, time - 1);
  18.             if (time - 1 == 0) {
  19.                 MinecraftServer.getServer().getConfigurationManager().sendChatMsg(new ChatComponentText(EnumChatFormatting.GREEN + c.name() + " can now be voted on again!"));
  20.                 typeCooldown.remove(c);
  21.             }
  22.         }
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment