Merge pull request #2498 from stormboomer/v3.0

Added functionality for restarting the scheduled job that stores markers
This commit is contained in:
mikeprimm 2019-06-09 07:31:27 -05:00 committed by GitHub
commit 881b7dfefd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -159,7 +159,9 @@ public class DynmapCore implements DynmapCommonAPI {
server = null;
markerapi = null;
}
public void restartMarkerSaveJob(){
this.markerapi.scheduleWriteJob();
}
// Set plugin jar file
public void setPluginJarFile(File f) {
jarfile = f;

View File

@ -407,7 +407,7 @@ public class MarkerAPIImpl implements MarkerAPI, Event.Listener<DynmapWorld> {
return api;
}
private void scheduleWriteJob() {
public void scheduleWriteJob() {
core.getServer().scheduleServerTask(new DoFileWrites(), 20);
}

View File

@ -796,6 +796,12 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
@Override
public void onEnable() {
if(core != null){
if(core.getMarkerAPI() != null){
getLogger().info("Starting Scheduled Write Job (markerAPI).");
core.restartMarkerSaveJob();
}
}
if (helper == null) {
Log.info("Dynmap is disabled (unsupported platform)");
return;