Add tileupdatedelay setting, compute more accurate bounding box for new chunks

This commit is contained in:
Mike Primm 2013-01-08 00:10:53 -06:00
parent bd12420edd
commit f43027f02f
2 changed files with 15 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import java.util.concurrent.Future;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
import org.bukkit.ChunkSnapshot;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
@ -1392,10 +1393,17 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
@EventHandler(priority=EventPriority.MONITOR)
public void onChunkPopulate(ChunkPopulateEvent event) {
Chunk c = event.getChunk();
ChunkSnapshot cs = c.getChunkSnapshot();
int ymax = 0;
for(int i = 0; i < c.getWorld().getMaxHeight() / 16; i++) {
if(!cs.isSectionEmpty(i)) {
ymax = (i+1)*16;
}
}
/* Touch extreme corners */
int x = c.getX() << 4;
int z = c.getZ() << 4;
mapManager.touchVolume(getWorld(event.getWorld()).getName(), x, 0, z, x+15, 128, z+16, "chunkpopulate");
mapManager.touchVolume(getWorld(event.getWorld()).getName(), x, 0, z, x+15, ymax, z+16, "chunkpopulate");
}
};
pm.registerEvents(chunkTrigger, this);

View File

@ -42,7 +42,7 @@ components:
hideifsneaking: false
# If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)
protected-player-info: false
@ If true, hide players with invisibility potion effects active
# If true, hide players with invisibility potion effects active
hide-if-invisiblity-potion: true
#- class: org.dynmap.JsonFileClientUpdateComponent
# writeinterval: 1
@ -186,6 +186,11 @@ saverestorepending: true
# Zoom-out tile update period - how often to scan for and process tile updates into zoom-out tiles (in seconds)
zoomoutperiod: 30
# Default delay on processing of updated tiles, in seconds. This can reduce potentially expensive re-rendering
# of frequently updated tiles (such as due to machines, pistons, quarries or other automation). Values can
# also be set on individual worlds and individual maps.
tileupdatedelay: 30
# Tile hashing is used to minimize tile file updates when no changes have occurred - set to false to disable
enabletilehash: true