RunSixtyTimesEverySec.java 696 B

12345678910111213141516171819202122232425
  1. package me.shedaniel.clothconfig2.api;
  2. import me.shedaniel.clothconfig2.impl.RunSixtyTimesEverySecImpl;
  3. import org.jetbrains.annotations.ApiStatus;
  4. @Deprecated
  5. @ApiStatus.ScheduledForRemoval
  6. public interface RunSixtyTimesEverySec {
  7. void run();
  8. default boolean isRegistered() {
  9. return RunSixtyTimesEverySecImpl.TICKS_LIST.contains(this);
  10. }
  11. default void registerTick() {
  12. RunSixtyTimesEverySecImpl.TICKS_LIST.removeIf(runSixtyTimesEverySec -> runSixtyTimesEverySec == this);
  13. RunSixtyTimesEverySecImpl.TICKS_LIST.add(this);
  14. }
  15. default void unregisterTick() {
  16. RunSixtyTimesEverySecImpl.TICKS_LIST.remove(this);
  17. }
  18. }