Fixed progress loading/saving and added msg
This commit is contained in:
parent
d25c038ec9
commit
fcae070f7f
2 changed files with 15 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
||||||
package iieLoadSaveEntireWorld;
|
package iieLoadSaveEntireWorld;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
public class ConfigProcess implements Runnable {
|
public class ConfigProcess implements Runnable {
|
||||||
|
@ -22,13 +23,13 @@ public class ConfigProcess implements Runnable {
|
||||||
config.getInt(name + ".width"),
|
config.getInt(name + ".width"),
|
||||||
new int[]
|
new int[]
|
||||||
{
|
{
|
||||||
config.getInt(name + ".currentRegion.x"),
|
config.getInt(name + ".lowerleft.x"),
|
||||||
config.getInt(name + ".currentRegion.z")
|
config.getInt(name + ".lowerleft.z")
|
||||||
},
|
},
|
||||||
new int[]
|
new int[]
|
||||||
{
|
{
|
||||||
config.getInt(name + ".lowerleft.x"),
|
config.getInt(name + ".currentRegion.x"),
|
||||||
config.getInt(name + ".lowerleft.z")
|
config.getInt(name + ".currentRegion.z")
|
||||||
},
|
},
|
||||||
config.getInt(name + ".n"),
|
config.getInt(name + ".n"),
|
||||||
config.getInt(name + ".c"),
|
config.getInt(name + ".c"),
|
||||||
|
@ -45,6 +46,12 @@ public class ConfigProcess implements Runnable {
|
||||||
{
|
{
|
||||||
if(config == null)
|
if(config == null)
|
||||||
config = Main.getPlugin().getConfig();
|
config = Main.getPlugin().getConfig();
|
||||||
|
Bukkit.getLogger().info("Loading in progress: " + name
|
||||||
|
+ "[" + TaskManager.loadProcess.currentRegion[0] + ","
|
||||||
|
+ TaskManager.loadProcess.currentRegion[1] + "]");
|
||||||
|
config.set(name + ".width", TaskManager.loadProcess.width);
|
||||||
|
config.set(name + ".lowerleft.x", TaskManager.loadProcess.lowerleft[0]);
|
||||||
|
config.set(name + ".lowerleft.z", TaskManager.loadProcess.lowerleft[1]);
|
||||||
config.set(name + ".currentRegion.x", TaskManager.loadProcess.currentRegion[0]);
|
config.set(name + ".currentRegion.x", TaskManager.loadProcess.currentRegion[0]);
|
||||||
config.set(name + ".currentRegion.z", TaskManager.loadProcess.currentRegion[1]);
|
config.set(name + ".currentRegion.z", TaskManager.loadProcess.currentRegion[1]);
|
||||||
config.set(name + ".n", TaskManager.loadProcess.n);
|
config.set(name + ".n", TaskManager.loadProcess.n);
|
||||||
|
|
|
@ -11,6 +11,7 @@ public class LoadProcess implements Runnable
|
||||||
final String worldname;
|
final String worldname;
|
||||||
final int totalRegions;
|
final int totalRegions;
|
||||||
int[] currentRegion;
|
int[] currentRegion;
|
||||||
|
int width;
|
||||||
|
|
||||||
|
|
||||||
LoadProcess(String name, WorldObject newWorld)
|
LoadProcess(String name, WorldObject newWorld)
|
||||||
|
@ -22,6 +23,7 @@ public class LoadProcess implements Runnable
|
||||||
currentRegion = newWorld.current;
|
currentRegion = newWorld.current;
|
||||||
|
|
||||||
this.lowerleft = newWorld.lowerleft;
|
this.lowerleft = newWorld.lowerleft;
|
||||||
|
width = newWorld.width;
|
||||||
allChunkCoords = generateAllChunkCoords(newWorld.width, newWorld.lowerleft);
|
allChunkCoords = generateAllChunkCoords(newWorld.width, newWorld.lowerleft);
|
||||||
}
|
}
|
||||||
LoadProcess(String name)
|
LoadProcess(String name)
|
||||||
|
@ -35,6 +37,7 @@ public class LoadProcess implements Runnable
|
||||||
currentRegion = unfinished.current;
|
currentRegion = unfinished.current;
|
||||||
|
|
||||||
this.lowerleft = unfinished.lowerleft;
|
this.lowerleft = unfinished.lowerleft;
|
||||||
|
width = unfinished.width;
|
||||||
allChunkCoords = generateAllChunkCoords(unfinished.width, unfinished.lowerleft);
|
allChunkCoords = generateAllChunkCoords(unfinished.width, unfinished.lowerleft);
|
||||||
|
|
||||||
this.n = unfinished.n;
|
this.n = unfinished.n;
|
||||||
|
@ -97,7 +100,7 @@ public class LoadProcess implements Runnable
|
||||||
|
|
||||||
//===============================CHUNK MAP==============================
|
//===============================CHUNK MAP==============================
|
||||||
|
|
||||||
private final int[] lowerleft;
|
final int[] lowerleft;
|
||||||
private final int[][][][][] allChunkCoords;
|
private final int[][][][][] allChunkCoords;
|
||||||
private final int[][][][][] generateAllChunkCoords(int w,int[] lowerleft)
|
private final int[][][][][] generateAllChunkCoords(int w,int[] lowerleft)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue