mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2024-11-29 21:43:30 +01:00
Critical fix: a bizarre Bukkit bug was resulting in the fill command sometimes wiping out the chunk at 0,0, even when it never even touched that chunk. The bug is caused by World.unloadChunk() in unknown circumstances. This workaround fix causes the task to speed along faster and memory usage to grow very quickly if you're running the fill task at a high frequency, so I've increased the "too low" memory threshold to 200 MB and increased the status update frequency and memory check to every 5 seconds (instead of every 10 seconds).
The status update frequency for the trim task has likewise been switched to every 5 seconds, for consistency.
This commit is contained in:
parent
933f9cac16
commit
548fbef7d6
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@
|
|||||||
/build
|
/build
|
||||||
/dist
|
/dist
|
||||||
/lib/GroupManager.jar
|
/lib/GroupManager.jar
|
||||||
|
/nbproject/pmd.settings
|
@ -134,8 +134,8 @@ public class WorldFillTask implements Runnable
|
|||||||
if (paused)
|
if (paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// every 10 seconds or so, give basic progress report to let user know how it's going
|
// every 5 seconds or so, give basic progress report to let user know how it's going
|
||||||
if (Config.Now() > lastReport + 10000)
|
if (Config.Now() > lastReport + 5000)
|
||||||
reportProgress();
|
reportProgress();
|
||||||
|
|
||||||
// if we've made it at least partly outside the border, skip past any such chunks
|
// if we've made it at least partly outside the border, skip past any such chunks
|
||||||
@ -172,10 +172,10 @@ public class WorldFillTask implements Runnable
|
|||||||
{
|
{
|
||||||
CoordXZ coord = storedChunks.remove(0);
|
CoordXZ coord = storedChunks.remove(0);
|
||||||
if (!originalChunks.contains(coord))
|
if (!originalChunks.contains(coord))
|
||||||
world.unloadChunk(coord.x, coord.z);
|
world.unloadChunkRequest(coord.x, coord.z);
|
||||||
coord = storedChunks.remove(0);
|
coord = storedChunks.remove(0);
|
||||||
if (!originalChunks.contains(coord))
|
if (!originalChunks.contains(coord))
|
||||||
world.unloadChunk(coord.x, coord.z);
|
world.unloadChunkRequest(coord.x, coord.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
// move on to next chunk
|
// move on to next chunk
|
||||||
@ -257,6 +257,7 @@ public class WorldFillTask implements Runnable
|
|||||||
// for successful completion
|
// for successful completion
|
||||||
public void finish()
|
public void finish()
|
||||||
{
|
{
|
||||||
|
this.paused = true;
|
||||||
reportProgress();
|
reportProgress();
|
||||||
world.save();
|
world.save();
|
||||||
sendMessage("task successfully completed!");
|
sendMessage("task successfully completed!");
|
||||||
@ -285,7 +286,7 @@ public class WorldFillTask implements Runnable
|
|||||||
{
|
{
|
||||||
CoordXZ coord = storedChunks.remove(0);
|
CoordXZ coord = storedChunks.remove(0);
|
||||||
if (!originalChunks.contains(coord))
|
if (!originalChunks.contains(coord))
|
||||||
world.unloadChunk(coord.x, coord.z);
|
world.unloadChunkRequest(coord.x, coord.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -334,7 +335,6 @@ public class WorldFillTask implements Runnable
|
|||||||
|
|
||||||
// try to keep memory usage in check and keep things speedy as much as possible...
|
// try to keep memory usage in check and keep things speedy as much as possible...
|
||||||
world.save();
|
world.save();
|
||||||
server.savePlayers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send a message to the server console/log and possibly to an in-game player
|
// send a message to the server console/log and possibly to an in-game player
|
||||||
@ -347,7 +347,7 @@ public class WorldFillTask implements Runnable
|
|||||||
if (notifyPlayer != null)
|
if (notifyPlayer != null)
|
||||||
notifyPlayer.sendMessage("[Fill] " + text);
|
notifyPlayer.sendMessage("[Fill] " + text);
|
||||||
|
|
||||||
if (availMem < 100)
|
if (availMem < 200)
|
||||||
{ // running low on memory, auto-pause
|
{ // running low on memory, auto-pause
|
||||||
pausedForMemory = true;
|
pausedForMemory = true;
|
||||||
Config.StoreFillTask();
|
Config.StoreFillTask();
|
||||||
|
@ -120,8 +120,8 @@ public class WorldTrimTask implements Runnable
|
|||||||
if (paused)
|
if (paused)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// every 10 seconds or so, give basic progress report to let user know how it's going
|
// every 5 seconds or so, give basic progress report to let user know how it's going
|
||||||
if (Config.Now() > lastReport + 10000)
|
if (Config.Now() > lastReport + 5000)
|
||||||
reportProgress();
|
reportProgress();
|
||||||
|
|
||||||
if (regionChunks.isEmpty())
|
if (regionChunks.isEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user