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 {
|
public class ConfigProcess implements Runnable {
|
||||||
|
|
||||||
//STATIC
|
//STATIC
|
||||||
private static final Main plugin = new Main();
|
static Main plugin;
|
||||||
private static final FileConfiguration config = plugin.getConfig();
|
static FileConfiguration config;
|
||||||
|
|
||||||
static final boolean isNew(String name)
|
static final boolean isNew(String name)
|
||||||
{
|
{
|
||||||
return !config.contains(name);
|
return !config.contains(name);
|
||||||
|
@ -75,7 +74,7 @@ public class ConfigProcess implements Runnable {
|
||||||
}
|
}
|
||||||
final void finish()
|
final void finish()
|
||||||
{
|
{
|
||||||
config.set("finished", name);
|
config.set("finished worlds, fully saved", name);
|
||||||
config.set(name, null);
|
config.set(name, null);
|
||||||
plugin.saveConfig();
|
plugin.saveConfig();
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,13 +80,10 @@ public class LoadProcess implements Runnable
|
||||||
d = 0;
|
d = 0;
|
||||||
if (B) D++;
|
if (B) D++;
|
||||||
switch (c){
|
switch (c){
|
||||||
case 1 : currentRegion[0]++; break;
|
case 1 : currentRegion[0]++; c++; break;
|
||||||
case 2 : currentRegion[1]++; break;
|
case 2 : currentRegion[1]++; c++; break;
|
||||||
case 3 : currentRegion[0]--; break;
|
case 3 : currentRegion[0]--; c++; break;
|
||||||
case 4 :
|
case 4 : currentRegion[1]--; c=1; break;
|
||||||
currentRegion[1]--;
|
|
||||||
c = c == 4 ? 1 : c + 1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
B = !B;
|
B = !B;
|
||||||
c++;
|
c++;
|
||||||
|
|
|
@ -3,17 +3,16 @@ package iieLoadSaveEntireWorld;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
public class Main extends JavaPlugin {
|
public class Main extends JavaPlugin {
|
||||||
private static Main plugin;
|
|
||||||
public static Main getPlugin()
|
|
||||||
{
|
|
||||||
return plugin;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
//saveDefaultConfig();
|
saveDefaultConfig();
|
||||||
plugin = this;
|
|
||||||
getCommand("beginfullmapload").setExecutor(new TaskManager.StartCommand());
|
getCommand("beginfullmapload").setExecutor(new TaskManager.StartCommand());
|
||||||
getCommand("stopfullmapload").setExecutor(new TaskManager.StopCommand());
|
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;
|
import org.bukkit.scheduler.BukkitTask;
|
||||||
|
|
||||||
public class TaskManager {
|
public class TaskManager {
|
||||||
|
|
||||||
|
static Main plugin;
|
||||||
|
|
||||||
static boolean inProgress = false;
|
static boolean inProgress = false;
|
||||||
static LoadProcess loadProcess;
|
static LoadProcess loadProcess;
|
||||||
static ConfigProcess configProcess;
|
static ConfigProcess configProcess;
|
||||||
|
@ -29,8 +32,8 @@ public class TaskManager {
|
||||||
isNew = false;
|
isNew = false;
|
||||||
}
|
}
|
||||||
TaskManager.configProcess = new ConfigProcess();
|
TaskManager.configProcess = new ConfigProcess();
|
||||||
TaskManager.loadTask = Bukkit.getScheduler().runTaskTimer( Main.getPlugin(), loadProcess, 0, 10 );
|
TaskManager.loadTask = Bukkit.getScheduler().runTaskTimer( plugin, loadProcess, 0, 5 );
|
||||||
TaskManager.configTask = Bukkit.getScheduler().runTaskTimer( Main.getPlugin(), configProcess, 0, 200 );
|
TaskManager.configTask = Bukkit.getScheduler().runTaskTimer( plugin, configProcess, 0, 200 );
|
||||||
return isNew;
|
return isNew;
|
||||||
}
|
}
|
||||||
static final void finish()
|
static final void finish()
|
||||||
|
|
Loading…
Reference in a new issue