Files
src
build.gradle
settings.gradle
Code
8 278
src/main/java/com/saynex/endtime/SaynexEndTime.java
package com.saynex.endtime;
import org.bukkit.plugin.java.JavaPlugin;
public final class SaynexEndTime extends JavaPlugin {
private CycleTimer cycleTimer;
private DecentHologramsHook hologramsHook;
@Override
public void onEnable() {
saveDefaultConfig();
long durationSeconds = getConfig().getLong("cycle-duration-seconds", 172800L);
if (durationSeconds < 1L) {
durationSeconds = 172800L;
getLogger().warning("cycle-duration-seconds must be greater than zero; using 172800 seconds.");
}
String timeFormat = getConfig().getString("time-format", "&e{days}д {hours}ч {minutes}м {seconds}с");
int refreshIntervalTicks = getConfig().getInt("refresh-interval-ticks", 20);
if (refreshIntervalTicks < 1) {
refreshIntervalTicks = 20;
}
cycleTimer = new CycleTimer(this, durationSeconds);
hologramsHook = new DecentHologramsHook(this, cycleTimer, timeFormat, refreshIntervalTicks);
hologramsHook.enable();
}
@Override
public void onDisable() {
if (hologramsHook != null) {
hologramsHook.disable();
}
}
}