From f43027f02fc80130c0586dfd86cb8323bce4b1e8 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 8 Jan 2013 00:10:53 -0600 Subject: [PATCH] Add tileupdatedelay setting, compute more accurate bounding box for new chunks --- src/main/java/org/dynmap/bukkit/DynmapPlugin.java | 10 +++++++++- src/main/resources/configuration.txt | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/bukkit/DynmapPlugin.java b/src/main/java/org/dynmap/bukkit/DynmapPlugin.java index 3bf2eaf2..ac6f978c 100644 --- a/src/main/java/org/dynmap/bukkit/DynmapPlugin.java +++ b/src/main/java/org/dynmap/bukkit/DynmapPlugin.java @@ -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); diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index af82274b..6bce16fe 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -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