Removing WorldUnloadTask
This commit is contained in:
parent
95c7220f4a
commit
452b3b4700
|
@ -85,7 +85,6 @@ import de.erethon.dungeonsxl.world.DResourceWorld;
|
|||
import de.erethon.dungeonsxl.world.DWorldListener;
|
||||
import de.erethon.dungeonsxl.world.LWCIntegration;
|
||||
import de.erethon.dungeonsxl.world.WorldConfig;
|
||||
import de.erethon.dungeonsxl.world.WorldUnloadTask;
|
||||
import de.erethon.vignette.api.VignetteAPI;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -352,7 +351,6 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
|
|||
if (!DResourceWorld.RAW.exists()) {
|
||||
DResourceWorld.createRaw();
|
||||
}
|
||||
new WorldUnloadTask(this).runTaskTimer(this, 20L, 20L);//1200L
|
||||
Bukkit.getPluginManager().registerEvents(new DWorldListener(this), this);
|
||||
if (LWCUtil.isLWCLoaded()) {
|
||||
new LWCIntegration(this);
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2012-2020 Frank Baumann
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package de.erethon.dungeonsxl.world;
|
||||
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
import de.erethon.dungeonsxl.api.world.InstanceWorld;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
/**
|
||||
* @author Frank Baumann, Daniel Saukel
|
||||
*/
|
||||
public class WorldUnloadTask extends BukkitRunnable {
|
||||
|
||||
private DungeonsXL plugin;
|
||||
|
||||
public WorldUnloadTask(DungeonsXL plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
plugin.getInstanceCache().getAllIf(i -> ((DInstanceWorld) i).exists() && i.getPlayers().isEmpty()).forEach(InstanceWorld::delete);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue