mirror of
https://github.com/trainerlord/WorldSystem.git
synced 2024-11-29 12:55:11 +01:00
Fixed version error
This commit is contained in:
parent
d0579b5f7e
commit
7b225b36e9
@ -1,6 +1,7 @@
|
||||
package de.butzlabben.world.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
/**
|
||||
* @author Butzlabben
|
||||
@ -49,4 +50,10 @@ public class VersionUtil {
|
||||
}
|
||||
return version;
|
||||
}
|
||||
|
||||
public static boolean isCancelled(BukkitTask task) {
|
||||
if(getVersion() <= 12)
|
||||
return false;
|
||||
return task.isCancelled();
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import de.butzlabben.world.event.WorldCreateEvent;
|
||||
import de.butzlabben.world.event.WorldLoadEvent;
|
||||
import de.butzlabben.world.event.WorldUnloadEvent;
|
||||
import de.butzlabben.world.util.PlayerPositions;
|
||||
import de.butzlabben.world.util.VersionUtil;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -444,7 +445,7 @@ public class SystemWorld {
|
||||
this.unloading = unloading;
|
||||
|
||||
// Cancel unload task if unloading is set to false
|
||||
if (!unloading && unloadLaterTask != null && !unloadLaterTask.isCancelled()) {
|
||||
if (!unloading && unloadLaterTask != null && !VersionUtil.isCancelled(unloadLaterTask)) {
|
||||
unloadLaterTask.cancel();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user