Remove unused imports, refactor ZA plugin
This commit is contained in:
parent
701d76167a
commit
b701d4d770
@ -8,7 +8,7 @@ import org.bukkit.Bukkit;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Logger;
|
||||
import com.ericdebouwer.zombieapocalypse.api.ApocalypseAPI;
|
||||
|
||||
|
||||
|
||||
public final class Servercore_za extends JavaPlugin {
|
||||
|
||||
@ -4,11 +4,13 @@ import com.ericdebouwer.zombieapocalypse.api.ApocalypseAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class StartNighttimeTask implements Listener {
|
||||
ApocalypseAPI apocalypseAPI = ApocalypseAPI.getInstance();
|
||||
public StartNighttimeTask() {
|
||||
Bukkit.getScheduler().runTaskTimer(Servercore_za.getPlugin(Servercore_za.class), () -> {
|
||||
ApocalypseAPI apocalypseAPI = ApocalypseAPI.getInstance();
|
||||
long time = Bukkit.getWorlds().getFirst().getTime(); // Get the time of the first world
|
||||
long time = Objects.requireNonNull(Bukkit.getWorld("world")).getTime();
|
||||
if (time >= 13000 && time <= 23000) { // Check if it is nighttime
|
||||
boolean isApocalyptic = apocalypseAPI.isApocalypse("world");
|
||||
if (isApocalyptic) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user