Drop autogenerate option

This commit is contained in:
Mike Primm 2013-02-24 20:24:05 -06:00
parent e6fe29f0c5
commit 55a5aacfce
2 changed files with 2 additions and 21 deletions

View File

@ -433,7 +433,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
c.setVisibleRange(limit);
}
c.setHiddenFillStyle(w.hiddenchunkstyle);
c.setAutoGenerateVisbileRanges(w.do_autogenerate);
}
if(w.hidden_limits != null) {
for(VisibilityLimit limit: w.hidden_limits) {

View File

@ -42,8 +42,6 @@ public class NewMapChunkCache implements MapChunkCache {
private HiddenChunkStyle hidestyle = HiddenChunkStyle.FILL_AIR;
private List<VisibilityLimit> visible_limits = null;
private List<VisibilityLimit> hidden_limits = null;
private boolean do_generate = false;
private boolean do_save = false;
private boolean isempty = true;
private ChunkSnapshot[] snaparray; /* Index = (x-x_min) + ((z-z_min)*x_dim) */
private DynIntHashMap[] snaptile;
@ -860,9 +858,6 @@ public class NewMapChunkCache implements MapChunkCache {
}
}
boolean didgenerate = false;
/* If we didn't load, and we're supposed to generate, do it */
if((!didload) && do_generate && vis)
didgenerate = didload = w.loadChunk(chunk.x, chunk.z, true);
/* If it did load, make cache of it */
if(didload) {
tileData = new DynIntHashMap();
@ -942,16 +937,14 @@ public class NewMapChunkCache implements MapChunkCache {
chunks_read++;
/* It looks like bukkit "leaks" entities - they don't get removed from the world-level table
* when chunks are unloaded but not saved - removing them seems to do the trick */
if(!(didgenerate && do_save)) {
helper.removeEntitiesFromChunk(c);
}
helper.removeEntitiesFromChunk(c);
/* Since we only remember ones we loaded, and we're synchronous, no player has
* moved, so it must be safe (also prevent chunk leak, which appears to happen
* because isChunkInUse defined "in use" as being within 256 blocks of a player,
* while the actual in-use chunk area for a player where the chunks are managed
* by the MC base server is 21x21 (or about a 160 block radius).
* Also, if we did generate it, need to save it */
w.unloadChunk(chunk.x, chunk.z, didgenerate && do_save, false);
w.unloadChunk(chunk.x, chunk.z, false, false);
}
else if (isunloadpending) { /* Else, if loaded and unload is pending */
w.unloadChunkRequest(chunk.x, chunk.z); /* Request new unload */
@ -1037,17 +1030,6 @@ public class NewMapChunkCache implements MapChunkCache {
public void setHiddenFillStyle(HiddenChunkStyle style) {
this.hidestyle = style;
}
/**
* Set autogenerate - must be done after at least one visible range has been set
*/
public void setAutoGenerateVisbileRanges(DynmapWorld.AutoGenerateOption generateopt) {
if((generateopt != DynmapWorld.AutoGenerateOption.NONE) && ((visible_limits == null) || (visible_limits.size() == 0))) {
Log.severe("Cannot setAutoGenerateVisibleRanges() without visible ranges defined");
return;
}
this.do_generate = (generateopt != DynmapWorld.AutoGenerateOption.NONE);
this.do_save = (generateopt == DynmapWorld.AutoGenerateOption.PERMANENT);
}
/**
* Add visible area limit - can be called more than once
* Needs to be set before chunks are loaded