Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void runnableRunner(){
- new BukkitRunnable(){
- @Override
- public void run() {
- if(abTime.isEmpty()){
- return;
- }
- Map<UUID, Integer> temp = abTime;
- for(UUID uuid : temp.keySet()){
- int ablength = temp.get(uuid);
- if(ablength == 0){
- abTime.remove(uuid);
- cdTime.put(uuid, mastercd);
- }else{
- abTime.put(uuid, ablength - 1);
- }
- }
- if(cdTime.isEmpty()){
- return;
- }
- Map<UUID, Integer> temp1 = cdTime;
- for(UUID uuid : temp1.keySet()){
- int timeLeft = temp1.get(uuid);
- if(timeLeft == 0){
- cdTime.remove(uuid);
- // Send a message that the cooldown is over
- }else{
- cdTime.put(uuid, timeLeft - 1);
- }
- }
- }
- }.runTaskTimer(instance, 0, 20);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement