ok NOW let's see if everything is fixed
This commit is contained in:
parent
fea4e41927
commit
d09b1c57b7
5 changed files with 20 additions and 21 deletions
1
config.yml
Normal file
1
config.yml
Normal file
|
@ -0,0 +1 @@
|
|||
finished worlds, fully saved:
|
|
@ -6,9 +6,8 @@ import org.bukkit.configuration.file.FileConfiguration;
|
|||
public class ConfigProcess implements Runnable {
|
||||
|
||||
//STATIC
|
||||
private static final Main plugin = new Main();
|
||||
private static final FileConfiguration config = plugin.getConfig();
|
||||
|
||||
static Main plugin;
|
||||
static FileConfiguration config;
|
||||
static final boolean isNew(String name)
|
||||
{
|
||||
return !config.contains(name);
|
||||
|
@ -75,7 +74,7 @@ public class ConfigProcess implements Runnable {
|
|||
}
|
||||
final void finish()
|
||||
{
|
||||
config.set("finished", name);
|
||||
config.set("finished worlds, fully saved", name);
|
||||
config.set(name, null);
|
||||
plugin.saveConfig();
|
||||
}
|
||||
|
|
|
@ -80,13 +80,10 @@ public class LoadProcess implements Runnable
|
|||
d = 0;
|
||||
if (B) D++;
|
||||
switch (c){
|
||||
case 1 : currentRegion[0]++; break;
|
||||
case 2 : currentRegion[1]++; break;
|
||||
case 3 : currentRegion[0]--; break;
|
||||
case 4 :
|
||||
currentRegion[1]--;
|
||||
c = c == 4 ? 1 : c + 1;
|
||||
break;
|
||||
case 1 : currentRegion[0]++; c++; break;
|
||||
case 2 : currentRegion[1]++; c++; break;
|
||||
case 3 : currentRegion[0]--; c++; break;
|
||||
case 4 : currentRegion[1]--; c=1; break;
|
||||
}
|
||||
B = !B;
|
||||
c++;
|
||||
|
|
|
@ -3,17 +3,16 @@ package iieLoadSaveEntireWorld;
|
|||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Main extends JavaPlugin {
|
||||
private static Main plugin;
|
||||
public static Main getPlugin()
|
||||
{
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public void onEnable()
|
||||
{
|
||||
//saveDefaultConfig();
|
||||
plugin = this;
|
||||
saveDefaultConfig();
|
||||
|
||||
getCommand("beginfullmapload").setExecutor(new TaskManager.StartCommand());
|
||||
getCommand("stopfullmapload").setExecutor(new TaskManager.StopCommand());
|
||||
|
||||
TaskManager.plugin = this;
|
||||
ConfigProcess.plugin = this;
|
||||
ConfigProcess.config = getConfig();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,9 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class TaskManager {
|
||||
|
||||
static Main plugin;
|
||||
|
||||
static boolean inProgress = false;
|
||||
static LoadProcess loadProcess;
|
||||
static ConfigProcess configProcess;
|
||||
|
@ -29,8 +32,8 @@ public class TaskManager {
|
|||
isNew = false;
|
||||
}
|
||||
TaskManager.configProcess = new ConfigProcess();
|
||||
TaskManager.loadTask = Bukkit.getScheduler().runTaskTimer( Main.getPlugin(), loadProcess, 0, 10 );
|
||||
TaskManager.configTask = Bukkit.getScheduler().runTaskTimer( Main.getPlugin(), configProcess, 0, 200 );
|
||||
TaskManager.loadTask = Bukkit.getScheduler().runTaskTimer( plugin, loadProcess, 0, 5 );
|
||||
TaskManager.configTask = Bukkit.getScheduler().runTaskTimer( plugin, configProcess, 0, 200 );
|
||||
return isNew;
|
||||
}
|
||||
static final void finish()
|
||||
|
|
Loading…
Reference in a new issue