aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java')
-rw-r--r--src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java b/src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java
index f9ed08e..3307167 100644
--- a/src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java
+++ b/src/main/java/world/anhgelus/manhunt/timer/TimerAccess.java
@@ -5,60 +5,60 @@ import net.minecraft.server.MinecraftServer;
import java.util.List;
public interface TimerAccess {
- /**
- * Get the timer linked to the overworld
- *
- * @param server Current server
- * @return TimerAccess linked to the overworld
- */
- static TimerAccess getTimerFromOverworld(MinecraftServer server) {
- final var timer = (TimerAccess) server.getOverworld();
- if (timer == null)
- throw new NullPointerException("Impossible to get TimerAccess from the overworld (it is null)");
- return timer;
- }
+ /**
+ * Get the timer linked to the overworld
+ *
+ * @param server Current server
+ * @return TimerAccess linked to the overworld
+ */
+ static TimerAccess getTimerFromOverworld(MinecraftServer server) {
+ final var timer = (TimerAccess) server.getOverworld();
+ if (timer == null)
+ throw new NullPointerException("Impossible to get TimerAccess from the overworld (it is null)");
+ return timer;
+ }
- /**
- * Run a task (called each tick ticked)
- *
- * @param task Task to run
- */
- void dds_runTask(TimerAccess.TickTask task);
+ /**
+ * Run a task (called each tick ticked)
+ *
+ * @param task Task to run
+ */
+ void dds_runTask(TimerAccess.TickTask task);
- void dds_cancel();
+ void dds_cancel();
- /**
- * @return All non-cancelled tasks
- */
- List<TickTask> dds_getTasks();
+ /**
+ * @return All non-cancelled tasks
+ */
+ List<TickTask> dds_getTasks();
- interface TickTask {
- /**
- * Tick the task
- */
- void tick();
+ interface TickTask {
+ /**
+ * Tick the task
+ */
+ void tick();
- /**
- * Cancel the task
- *
- * @return the remaining ticks before the run of the Task
- * @throws IllegalStateException if the task is already cancelled
- */
- long cancel();
+ /**
+ * Cancel the task
+ *
+ * @return the remaining ticks before the run of the Task
+ * @throws IllegalStateException if the task is already cancelled
+ */
+ long cancel();
- boolean isRunning();
+ boolean isRunning();
- /**
- * @return the number of ticks before run of the task (if the task is cancelled, returns -1)
- */
- long getTickingBeforeRun();
- }
+ /**
+ * @return the number of ticks before run of the task (if the task is cancelled, returns -1)
+ */
+ long getTickingBeforeRun();
+ }
- /**
- * Represents a task to run after ticking
- */
- @FunctionalInterface
- interface Task {
- void run();
- }
+ /**
+ * Represents a task to run after ticking
+ */
+ @FunctionalInterface
+ interface Task {
+ void run();
+ }
} \ No newline at end of file