From 380caf1ca32efd57689ccc995456279d43999958 Mon Sep 17 00:00:00 2001 From: Driftay Date: Tue, 7 Apr 2020 22:24:07 -0400 Subject: [PATCH] More things to GraceTimer --- .../factions/util/timer/GlobalTimer.java | 8 ++++++++ .../massivecraft/factions/util/timer/Timer.java | 2 -- .../factions/util/timer/TimerRunnable.java | 1 - .../factions/util/timer/type/GraceTimer.java | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/util/timer/GlobalTimer.java b/src/main/java/com/massivecraft/factions/util/timer/GlobalTimer.java index 57a41b24..6eddd4d8 100644 --- a/src/main/java/com/massivecraft/factions/util/timer/GlobalTimer.java +++ b/src/main/java/com/massivecraft/factions/util/timer/GlobalTimer.java @@ -1,5 +1,12 @@ package com.massivecraft.factions.util.timer; +import com.massivecraft.factions.util.Config; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + /** * Factions - Developed by Driftay. * All rights reserved 2020. @@ -8,6 +15,7 @@ package com.massivecraft.factions.util.timer; public abstract class GlobalTimer extends Timer { private TimerRunnable runnable; + public GlobalTimer(String name, long defaultCooldown) { super(name, defaultCooldown); } diff --git a/src/main/java/com/massivecraft/factions/util/timer/Timer.java b/src/main/java/com/massivecraft/factions/util/timer/Timer.java index d9596cc4..d04bcdaf 100644 --- a/src/main/java/com/massivecraft/factions/util/timer/Timer.java +++ b/src/main/java/com/massivecraft/factions/util/timer/Timer.java @@ -1,8 +1,6 @@ package com.massivecraft.factions.util.timer; -import com.massivecraft.factions.FactionsPlugin; import com.massivecraft.factions.util.Config; -import com.massivecraft.factions.util.timer.type.GraceTimer; /** * Factions - Developed by Driftay. diff --git a/src/main/java/com/massivecraft/factions/util/timer/TimerRunnable.java b/src/main/java/com/massivecraft/factions/util/timer/TimerRunnable.java index c14f0a3c..af426821 100644 --- a/src/main/java/com/massivecraft/factions/util/timer/TimerRunnable.java +++ b/src/main/java/com/massivecraft/factions/util/timer/TimerRunnable.java @@ -1,7 +1,6 @@ package com.massivecraft.factions.util.timer; import com.massivecraft.factions.FactionsPlugin; -import com.massivecraft.factions.util.Config; import java.util.UUID; diff --git a/src/main/java/com/massivecraft/factions/util/timer/type/GraceTimer.java b/src/main/java/com/massivecraft/factions/util/timer/type/GraceTimer.java index da98c39a..cde70416 100644 --- a/src/main/java/com/massivecraft/factions/util/timer/type/GraceTimer.java +++ b/src/main/java/com/massivecraft/factions/util/timer/type/GraceTimer.java @@ -3,6 +3,7 @@ package com.massivecraft.factions.util.timer.type; import com.massivecraft.factions.Conf; import com.massivecraft.factions.FPlayer; import com.massivecraft.factions.FPlayers; +import com.massivecraft.factions.util.Config; import com.massivecraft.factions.util.timer.GlobalTimer; import org.bukkit.Material; import org.bukkit.event.EventHandler; @@ -40,4 +41,17 @@ public class GraceTimer extends GlobalTimer implements Listener { } } } + + @Override + public void load(Config config) { + config.get(this.name, isPaused()); + config.get(this.name, getRemaining()); + } + + @Override + public void save(Config config) { + config.set(this.name, isPaused()); + config.set(this.name, getRemaining()); + } + }